"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["copilot-chat","dashboard-lists","lazy-react-partial-copilot-chat"],{8625:(c,e,a)=>{a.d(e,{H:()=>l});var t=a(96540);let l=({inputRef:c,fallbackEventHandler:e})=>(0,t.useCallback)((a,t,l)=>{let n=c.current;if(!n)return;let r=document.activeElement;n.focus();let o=t??[n.selectionStart??n.value.length,n.selectionEnd??n.value.length],i=void 0===l?((c,e,a)=>{let t=e[1]-e[0];return c({...c,nativeEvent:c,target:e,currentTarget:e,preventDefault:()=>c.preventDefault(),isDefaultPrevented:()=>c.defaultPrevented,isPropagationStopped:()=>!1,persist:()=>({})}))(l,c.current))}},[c,e])},10242:(c,e,a)=>{a.d(e,{A:()=>r});var t=a(74848),l=a(57352);let n={link:"FeedbackLink-module__link--Ga4DP"},r=({feedbackUrl:c})=>(0,t.jsx)(l.A,{className:n.link,href:c,children:"Give feedback"});try{r.displayName||(r.displayName="FeedbackLink")}catch{}},17005:(c,e,a)=>{a.d(e,{l:()=>z});var t=a(74848),l=a(21728),n=a(77274),r=a(96379),o=a(96540),i=a(35247),s=a(54508);let m=[{name:"Hate it",value:"VERY_NEGATIVE",icon:n.YS,color:"veryDissatisfied"},{name:"Not great",value:"NEGATIVE",icon:n.Mm,color:"dissatisfied"},{name:"It\u2019s ok",value:"POSITIVE",icon:n.Cf,color:"satisfied"},{name:"Love it",value:"VERY_POSITIVE",icon:n.mN,color:"verySatisfied"}],z=(0,o.forwardRef)(function(c,e){let a,z,d,h,p=(0,l.c)(7),{mode:u,returnFocusRef:M}=c,f=(0,o.useRef)(null),x=(0,o.useRef)(null),g=(0,o.useRef)(void 0);p[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>({openDialog:c=>{g.current=c,i.W.copilotChatInterviewSurvey?f.current?.openDialog():x.current?.openDialog(c)}}),p[0]=a):a=p[0],(0,o.useImperativeHandle)(e,a),p[1]!==u?(z=async(c,e)=>{let a=[];if(null==c&&a.push("Please select a rating."),e.length>2e3&&a.push("Please keep your feedback within 2000 characters or less."),a.length>0)return a;let t={rating:c,content:e,hostname:window.location.hostname,path:window.location.pathname,mode:u};try{(await (0,r.lS)("/github-copilot/feedback",{method:"POST",body:t})).ok||a.push("An error occurred while submitting your feedback.")}catch{a.push("An error occurred while submitting your feedback.")}return a},p[1]=u,p[2]=z):z=p[2];let v=z;return p[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)(s.E,{ref:f,onClose:c=>{"no-thanks"===c&&x.current?.openDialog(g.current)}}),p[3]=d):d=p[3],p[4]!==v||p[5]!==M?(h=(0,t.jsxs)(t.Fragment,{children:[d,(0,t.jsx)(n.NE,{ref:x,options:m,onSubmit:v,returnFocusRef:M})]}),p[4]=v,p[5]=M,p[6]=h):h=p[6],h});z.displayName="ConversationFeedbackDialog"},18308:(c,e,a)=>{var t=a(7123),l=a(74848),n=a(21728),r=a(10436),o=a(94195),i=a(2635),s=a(33592),m=a(25641),z=a(97286),d=a(77430),h=a(25407),p=a(68911),u=a(71315),M=a(45385),f=a(91547),x=a(38621),g=a(62935),v=a(26108),C=a(87448),_=a(96540),j=a(37178),b=a(73017);function y(c){let e,a,t,r,o=(0,n.c)(11),{lineNumbers:i,lines:s,trimLineBeginnings:m}=c;if(o[0]===Symbol.for("react.memo_cache_sentinel")?(e={display:"flex",flexDirection:"row",overflowX:"auto",pb:3},a={fontSize:"12px",fontFamily:"var(--fontStack-monospace)",overflowX:"auto"},o[0]=e,o[1]=a):(e=o[0],a=o[1]),o[2]!==i||o[3]!==s||o[4]!==m){let c;o[6]!==s||o[7]!==m?(c=(c,e)=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:c},c),(0,l.jsx)("td",{style:{whiteSpace:"pre",paddingLeft:"16px"},children:(0,l.jsx)(b.$6,{html:m?(s[e]??"").trimStart():s[e]||` `},`line-${e}`)})]},`line-row-${c}`),o[6]=s,o[7]=m,o[8]=c):c=o[8],t=i.map(c),o[2]=i,o[3]=s,o[4]=m,o[5]=t}else t=o[5];return o[9]!==t?(r=(0,l.jsx)(C.az,{sx:e,children:(0,l.jsx)("table",{style:a,children:t})}),o[9]=t,o[10]=r):r=o[10],r}try{y.displayName||(y.displayName="SimpleCodeListing")}catch{}function w(c){let e,a,t,r,o,i,s,m,z,u,v,b,w,k,A,D,R,E,L,P,T,B,V,$,F,H,W,U,q,G,J=(0,n.c)(88),{reference:K,details:Y,detailsLoading:Q,detailsError:X,onDismiss:Z}=c,{contributors:cc}=(0,M.u)(K.repoOwner,K.repoName,K.commitOID,K.path),[ce]=(0,f.E)(K.repoOwner,K.repoName,K.commitOID,K.path),{lines:ca,lineNumbers:ct,expandUp:cl,expandDown:cn}=function(c,e,a){let t,l,r,o,i,s,m,z,d=(0,n.c)(42),[h,p]=(0,_.useState)(c?.start??-1),[u,M]=(0,_.useState)(c?.end??-1);d[0]!==a||d[1]!==e||d[2]!==c?(t=a&&c&&e?a.slice(c.start-e.start,c.end-e.start+1):[],d[0]=a,d[1]=e,d[2]=c,d[3]=t):t=d[3];let[f,x]=(0,_.useState)(t);d[4]!==a||d[5]!==u||d[6]!==e||d[7]!==c||d[8]!==h?(l=(t,l)=>{let n=void 0===t?h:t,r=void 0===l?u:l;a&&c&&e&&!(n<0)&&!(r<0)&&x(a.slice(n-e.start,r-e.start+1))},d[4]=a,d[5]=u,d[6]=e,d[7]=c,d[8]=h,d[9]=l):l=d[9];let g=l;d[10]!==a||d[11]!==u||d[12]!==c||d[13]!==h||d[14]!==g?(r=()=>{if(c&&a&&(-1===h||-1===u)){let e=c.start,a=c.end;p(e),M(a),g(e,a)}},d[10]=a,d[11]=u,d[12]=c,d[13]=h,d[14]=g,d[15]=r):r=d[15],d[16]!==a||d[17]!==u||d[18]!==e||d[19]!==c||d[20]!==h||d[21]!==g?(o=[a,c,e,g,h,u],d[16]=a,d[17]=u,d[18]=e,d[19]=c,d[20]=h,d[21]=g,d[22]=o):o=d[22],(0,_.useEffect)(r,o),d[23]!==e?.start||d[24]!==h||d[25]!==g?(i=()=>{let c=Math.max(h-O,e?.start??-1);p(c),g(c)},d[23]=e?.start,d[24]=h,d[25]=g,d[26]=i):i=d[26],e?.start;let v=i;d[27]!==u||d[28]!==e?.end||d[29]!==h||d[30]!==g?(s=()=>{let c=Math.min(u+O,e?.end??-1);M(c),g(h,c)},d[27]=u,d[28]=e?.end,d[29]=h,d[30]=g,d[31]=s):s=d[31],e?.end;let C=s,j=-1!==h&&h!==e?.start,b=-1!==u&&u!==e?.end;if(d[32]!==f||d[33]!==h){let c;d[35]!==h?(c=(c,e)=>h+e,d[35]=h,d[36]=c):c=d[36],m=f.map(c),d[32]=f,d[33]=h,d[34]=m}else m=d[34];let y=j?v:null,w=b?C:null;return d[37]!==f||d[38]!==m||d[39]!==y||d[40]!==w?(z={lines:f,lineNumbers:m,expandUp:y,expandDown:w},d[37]=f,d[38]=m,d[39]=y,d[40]=w,d[41]=z):z=d[41],z}(Y?.range,Y?.expandedRange,Y?.highlightedContents),cr=Y?.headerInfo,co=Y?.repoIsOrgOwned,ci=`${K.repoOwner}.png`;return J[0]===Symbol.for("react.memo_cache_sentinel")?(e={mr:2,flexShrink:0},J[0]=e):e=J[0],J[1]!==co||J[2]!==ci?(a=(0,l.jsx)(d.r,{square:co,src:ci,sx:e}),J[1]=co,J[2]=ci,J[3]=a):a=J[3],J[4]===Symbol.for("react.memo_cache_sentinel")?(t={fontWeight:600,whiteSpace:"nowrap"},J[4]=t):t=J[4],J[5]!==K.repoName||J[6]!==K.repoOwner?(r=(0,l.jsxs)(C.EY,{sx:t,children:[K.repoOwner,"/",K.repoName]}),J[5]=K.repoName,J[6]=K.repoOwner,J[7]=r):r=J[7],J[8]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsx)(C.EY,{sx:{marginX:1},children:"\xb7"}),J[8]=o):o=J[8],J[9]===Symbol.for("react.memo_cache_sentinel")?(i={fontWeight:400},J[9]=i):i=J[9],J[10]!==K.ref?(s=(0,p.gE)(K.ref),J[10]=K.ref,J[11]=s):s=J[11],J[12]!==s?(m=(0,l.jsx)(C.EY,{sx:i,children:s}),J[12]=s,J[13]=m):m=J[13],J[14]===Symbol.for("react.memo_cache_sentinel")?(z=(0,l.jsx)(C.EY,{sx:{marginX:1},children:"\xb7"}),J[14]=z):z=J[14],J[15]===Symbol.for("react.memo_cache_sentinel")?(u={fontWeight:400,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",direction:"rtl"},J[15]=u):u=J[15],J[16]!==K.path?(v=(0,l.jsx)(C.EY,{sx:u,children:K.path}),J[16]=K.path,J[17]=v):v=J[17],J[18]!==K.range||J[19]!==K.type?(b="snippet"===K.type&&(0,l.jsxs)("span",{children:[":",K.range.start,"-",K.range.end]}),J[18]=K.range,J[19]=K.type,J[20]=b):b=J[20],J[21]!==Z||J[22]!==m||J[23]!==v||J[24]!==b||J[25]!==a||J[26]!==r?(w=(0,l.jsxs)(j.O.Header,{onDismiss:Z,children:[a,r,o,m,z,v,b]}),J[21]=Z,J[22]=m,J[23]=v,J[24]=b,J[25]=a,J[26]=r,J[27]=w):w=J[27],J[28]===Symbol.for("react.memo_cache_sentinel")?(k={border:"1px solid var(--borderColor-default, var(--color-border-default))",borderRadius:"6px 6px 0 0",marginX:3},J[28]=k):k=J[28],J[29]!==cr?(A=cr&&(0,l.jsx)(N,{headerInfo:cr}),J[29]=cr,J[30]=A):A=J[30],J[31]!==cr?(D=cr&&(0,l.jsx)(I,{headerInfo:cr}),J[31]=cr,J[32]=D):D=J[32],J[33]!==A||J[34]!==D?(R=(0,l.jsxs)(S,{children:[A,D]}),J[33]=A,J[34]=D,J[35]=R):R=J[35],J[36]!==cl?(E=cl&&(0,l.jsx)(j.O.ContentExpander,{direction:"above",onExpand:cl}),J[36]=cl,J[37]=E):E=J[37],J[38]!==ct||J[39]!==ca?(L=(0,l.jsx)(j.O.Content,{children:(0,l.jsx)(y,{lines:ca,lineNumbers:ct})}),J[38]=ct,J[39]=ca,J[40]=L):L=J[40],J[41]!==cn?(P=cn&&(0,l.jsx)(j.O.ContentExpander,{direction:"below",onExpand:cn}),J[41]=cn,J[42]=P):P=J[42],J[43]!==R||J[44]!==E||J[45]!==L||J[46]!==P?(T=(0,l.jsxs)(C.az,{sx:k,children:[R,E,L,P]}),J[43]=R,J[44]=E,J[45]=L,J[46]=P,J[47]=T):T=J[47],J[48]!==K.repoName||J[49]!==K.repoOwner?(B=(0,h.Do2)({name:K.repoName,ownerLogin:K.repoOwner}),J[48]=K.repoName,J[49]=K.repoOwner,J[50]=B):B=J[50],J[51]!==K.repoName||J[52]!==K.repoOwner||J[53]!==B?(V=(0,l.jsxs)(j.O.DetailLink,{href:B,icon:x.RepoIcon,children:[K.repoOwner,"/",K.repoName]}),J[51]=K.repoName,J[52]=K.repoOwner,J[53]=B,J[54]=V):V=J[54],J[55]!==cc||J[56]!==Y?.range||J[57]!==K.commitOID||J[58]!==K.path||J[59]!==K.repoName||J[60]!==K.repoOwner?($=cc&&(0,l.jsxs)(j.O.DetailLink,{icon:x.PeopleIcon,href:(0,h.buO)({owner:K.repoOwner,repo:K.repoName,commitish:K.commitOID,filePath:K.path,lineNumber:Y?.range.start}),children:[cc.totalCount," ",1===cc.totalCount?"contributor":"contributors"]}),J[55]=cc,J[56]=Y?.range,J[57]=K.commitOID,J[58]=K.path,J[59]=K.repoName,J[60]=K.repoOwner,J[61]=$):$=J[61],J[62]!==ce||J[63]!==K.repoName||J[64]!==K.repoOwner?(F=ce&&(0,l.jsxs)(j.O.DetailLink,{icon:x.HistoryIcon,href:(0,h.$Qz)({owner:K.repoOwner,repo:K.repoName,commitish:ce?.oid}),children:[ce?.author?.displayName," updated ",(0,l.jsx)(g.A,{datetime:ce?.date})]}),J[62]=ce,J[63]=K.repoName,J[64]=K.repoOwner,J[65]=F):F=J[65],J[66]!==K.range||J[67]!==K.type?(H="snippet"===K.type?(0,l.jsxs)(l.Fragment,{children:["#",K.range.start,"-",K.range.end]}):null,J[66]=K.range,J[67]=K.type,J[68]=H):H=J[68],J[69]!==K.path||J[70]!==K.repoName||J[71]!==K.repoOwner||J[72]!==K.url||J[73]!==H?(W=(0,l.jsxs)(j.O.DetailLink,{icon:x.LinkExternalIcon,href:K.url,children:[K.repoOwner,"/",K.repoName,"/",K.path,H]}),J[69]=K.path,J[70]=K.repoName,J[71]=K.repoOwner,J[72]=K.url,J[73]=H,J[74]=W):W=J[74],J[75]!==V||J[76]!==$||J[77]!==F||J[78]!==W?(U=(0,l.jsxs)(j.O.Details,{children:[V,$,F,W]}),J[75]=V,J[76]=$,J[77]=F,J[78]=W,J[79]=U):U=J[79],J[80]!==X||J[81]!==Q||J[82]!==T||J[83]!==U?(q=(0,l.jsxs)(j.O.Body,{detailsError:X,detailsLoading:Q,children:[T,U]}),J[80]=X,J[81]=Q,J[82]=T,J[83]=U,J[84]=q):q=J[84],J[85]!==w||J[86]!==q?(G=(0,l.jsxs)(j.O.Frame,{children:[w,q]}),J[85]=w,J[86]=q,J[87]=G):G=J[87],G}function S(c){let e,a,t=(0,n.c)(3),{children:r}=c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={p:2,display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",backgroundColor:"canvas.subtle",borderBottom:"1px solid var(--borderColor-default, var(--color-border-default))",borderRadius:"6px 6px 0px 0px"},t[0]=e):e=t[0],t[1]!==r?(a=(0,l.jsx)(C.az,{sx:e,children:r}),t[1]=r,t[2]=a):a=t[2],a}function N(c){let e,a,t,r=(0,n.c)(6),{headerInfo:o}=c;r[0]===Symbol.for("react.memo_cache_sentinel")?(e={maxWidth:"100%",color:"fg.subtle"},r[0]=e):e=r[0];let i=`${o.lineInfo.truncatedLoc} lines (${o.lineInfo.truncatedSloc} loc) \xb7 ${o.blobSize}`;return r[1]!==i?(a=(0,l.jsx)("span",{children:i}),r[1]=i,r[2]=a):a=r[2],r[3]!==o.blobSize||r[4]!==a?(t=(0,l.jsx)(C.PA,{title:o.blobSize,inline:!0,sx:e,"data-testid":"blob-size",children:a}),r[3]=o.blobSize,r[4]=a,r[5]=t):t=r[5],t}function I(c){let e,a=(0,n.c)(17),{headerInfo:t}=c;if(a[0]!==t.displayName||a[1]!==t.isLfs||a[2]!==t.rawBlobUrl||a[3]!==t.viewable){let c,n,r,o,i,s,m=new URL(t.rawBlobUrl,u.fV.origin);m.searchParams.set("download",""),a[5]!==t.displayName||a[6]!==t.isLfs||a[7]!==t.rawBlobUrl?(c=async()=>{t.isLfs||await A(t.rawBlobUrl,t.displayName)},a[5]=t.displayName,a[6]=t.isLfs,a[7]=t.rawBlobUrl,a[8]=c):c=a[8],a[9]===Symbol.for("react.memo_cache_sentinel")?(n={borderTopLeftRadius:0,borderBottomLeftRadius:0},a[9]=n):n=a[9],a[10]!==c?(r={"aria-label":"Download raw content",icon:x.DownloadIcon,size:"small",onClick:c,"data-testid":"download-raw-button",sx:n},a[10]=c,a[11]=r):r=a[11];let z=r;a[12]===Symbol.for("react.memo_cache_sentinel")?(o={display:"flex"},a[12]=o):o=a[12];let d=t.viewable?void 0:"true";a[13]===Symbol.for("react.memo_cache_sentinel")?(i={linkButtonSx:k,px:2,borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"none"},a[13]=i):i=a[13],a[14]!==t.rawBlobUrl||a[15]!==d?(s=(0,l.jsx)(C.z9,{href:t.rawBlobUrl,download:d,size:"small",sx:i,"data-testid":"raw-button",children:"Raw"}),a[14]=t.rawBlobUrl,a[15]=d,a[16]=s):s=a[16],e=(0,l.jsxs)(C.az,{sx:o,children:[s,t.isLfs?(0,l.jsx)(v.K,{unsafeDisableTooltip:!0,as:"a","data-turbo":"false",href:m.toString(),...z}):(0,l.jsx)(v.K,{unsafeDisableTooltip:!0,...z})]}),a[0]=t.displayName,a[1]=t.isLfs,a[2]=t.rawBlobUrl,a[3]=t.viewable,a[4]=e}else e=a[4];return e}let O=25,k={"&:hover:not([disabled])":{textDecoration:"none"},"&:focus:not([disabled])":{textDecoration:"none"},"&:active:not([disabled])":{textDecoration:"none"}};async function A(c,e){let a=await fetch(c,{method:"get"}),t=await a.blob(),l=document.createElement("a");l.setAttribute("download",e);let n=URL.createObjectURL(t);l.href=n,l.setAttribute("target","_blank"),l.click(),URL.revokeObjectURL(n)}try{w.displayName||(w.displayName="CodeReferencePreview")}catch{}try{S.displayName||(S.displayName="BlobPreviewHeader")}catch{}try{N.displayName||(N.displayName="BlobSize")}catch{}try{I.displayName||(I.displayName="RawButtons")}catch{}var D=a(4817);function R(c){let e,a,t,o,i,s,m,z,p,u,M,f,g,v,_,b,y,w,S,N=(0,n.c)(45),{reference:I,detailsLoading:O,detailsError:k,onDismiss:A}=c;N[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(r.m4,{icon:x.GitCommitIcon,sx:{mr:2}}),N[0]=e):e=N[0],N[1]===Symbol.for("react.memo_cache_sentinel")?(a={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},N[1]=a):a=N[1],N[2]!==I.message?(t=(0,l.jsx)(C.az,{sx:a,children:I.message}),N[2]=I.message,N[3]=t):t=N[3],N[4]!==A||N[5]!==t?(o=(0,l.jsxs)(j.O.Header,{onDismiss:A,children:[e,t]}),N[4]=A,N[5]=t,N[6]=o):o=N[6],N[7]===Symbol.for("react.memo_cache_sentinel")?(i={display:"flex",flexDirection:"row",p:3},N[7]=i):i=N[7];let R=`${I.author.login}.png`;return N[8]===Symbol.for("react.memo_cache_sentinel")?(s={mr:2,flexShrink:0},N[8]=s):s=N[8],N[9]!==R?(m=(0,l.jsx)(d.r,{src:R,sx:s}),N[9]=R,N[10]=m):m=N[10],N[11]===Symbol.for("react.memo_cache_sentinel")?(z={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",direction:"rtl"},N[11]=z):z=N[11],N[12]!==I.author.login?(p=(0,l.jsx)(C.az,{sx:z,children:I.author.login}),N[12]=I.author.login,N[13]=p):p=N[13],N[14]!==p||N[15]!==m?(u=(0,l.jsxs)(C.az,{sx:i,children:[m,p]}),N[14]=p,N[15]=m,N[16]=u):u=N[16],N[17]===Symbol.for("react.memo_cache_sentinel")?(M=(0,l.jsx)(C.az,{sx:{borderBottom:"1px solid var(--borderColor-default, var(--color-border-default))"}}),N[17]=M):M=N[17],N[18]!==I.message?(f=(0,l.jsx)(j.O.Content,{children:(0,l.jsx)(D.To,{markdown:I.message})}),N[18]=I.message,N[19]=f):f=N[19],N[20]===Symbol.for("react.memo_cache_sentinel")?(g=(0,l.jsx)(C.az,{sx:{borderBottom:"1px solid var(--borderColor-default, var(--color-border-default))"}}),N[20]=g):g=N[20],N[21]!==I.repository.name||N[22]!==I.repository.owner?(v=(0,h.Do2)({name:I.repository.name,ownerLogin:I.repository.owner}),N[21]=I.repository.name,N[22]=I.repository.owner,N[23]=v):v=N[23],N[24]!==I.repository.name||N[25]!==I.repository.owner||N[26]!==v?(_=(0,l.jsxs)(j.O.DetailLink,{href:v,icon:x.RepoIcon,children:[I.repository.owner,"/",I.repository.name]}),N[24]=I.repository.name,N[25]=I.repository.owner,N[26]=v,N[27]=_):_=N[27],N[28]!==I.oid||N[29]!==I.permalink||N[30]!==I.repository.name||N[31]!==I.repository.owner?(b=(0,l.jsxs)(j.O.DetailLink,{href:I.permalink,icon:x.LinkExternalIcon,children:[I.repository.owner,"/",I.repository.name,"/commit/",I.oid]}),N[28]=I.oid,N[29]=I.permalink,N[30]=I.repository.name,N[31]=I.repository.owner,N[32]=b):b=N[32],N[33]!==_||N[34]!==b?(y=(0,l.jsxs)(j.O.Details,{children:[_,b]}),N[33]=_,N[34]=b,N[35]=y):y=N[35],N[36]!==k||N[37]!==O||N[38]!==u||N[39]!==f||N[40]!==y?(w=(0,l.jsxs)(j.O.Body,{detailsError:k,detailsLoading:O,children:[u,M,f,g,y]}),N[36]=k,N[37]=O,N[38]=u,N[39]=f,N[40]=y,N[41]=w):w=N[41],N[42]!==w||N[43]!==o?(S=(0,l.jsxs)(j.O.Frame,{children:[o,w]}),N[42]=w,N[43]=o,N[44]=S):S=N[44],S}try{R.displayName||(R.displayName="CommitReferencePreview")}catch{}var E=a(59121);let L={SegmentedControl:"MarkdownReferencePreview-module__SegmentedControl--Q7TCz"};function P(c){let e,a,t,r,o,i,s,m,z,u,v,_,b,y,w,S,N,I,O,k,A,D,R=(0,n.c)(65),{reference:E,details:L,detailsLoading:P,detailsError:B,onDismiss:V}=c,{contributors:$}=(0,M.u)(E.repoOwner,E.repoName,E.commitOID,E.path),[F]=(0,f.E)(E.repoOwner,E.repoName,E.commitOID,E.path),H=L?.repoIsOrgOwned,W=`${E.repoOwner}.png`;return R[0]===Symbol.for("react.memo_cache_sentinel")?(e={mr:2,flexShrink:0},R[0]=e):e=R[0],R[1]!==H||R[2]!==W?(a=(0,l.jsx)(d.r,{square:H,src:W,sx:e}),R[1]=H,R[2]=W,R[3]=a):a=R[3],R[4]===Symbol.for("react.memo_cache_sentinel")?(t={fontWeight:600,whiteSpace:"nowrap"},R[4]=t):t=R[4],R[5]!==E.repoName||R[6]!==E.repoOwner?(r=(0,l.jsxs)(C.EY,{sx:t,children:[E.repoOwner,"/",E.repoName]}),R[5]=E.repoName,R[6]=E.repoOwner,R[7]=r):r=R[7],R[8]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsx)(C.EY,{sx:{marginX:1},children:"\xb7"}),R[8]=o):o=R[8],R[9]===Symbol.for("react.memo_cache_sentinel")?(i={fontWeight:400},R[9]=i):i=R[9],R[10]!==E.ref?(s=(0,p.gE)(E.ref),R[10]=E.ref,R[11]=s):s=R[11],R[12]!==s?(m=(0,l.jsx)(C.EY,{sx:i,children:s}),R[12]=s,R[13]=m):m=R[13],R[14]===Symbol.for("react.memo_cache_sentinel")?(z=(0,l.jsx)(C.EY,{sx:{marginX:1},children:"\xb7"}),R[14]=z):z=R[14],R[15]===Symbol.for("react.memo_cache_sentinel")?(u={fontWeight:400,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",direction:"rtl"},R[15]=u):u=R[15],R[16]!==E.path?(v=(0,l.jsx)(C.EY,{sx:u,children:E.path}),R[16]=E.path,R[17]=v):v=R[17],R[18]!==V||R[19]!==m||R[20]!==v||R[21]!==a||R[22]!==r?(_=(0,l.jsxs)(j.O.Header,{onDismiss:V,children:[a,r,o,m,z,v]}),R[18]=V,R[19]=m,R[20]=v,R[21]=a,R[22]=r,R[23]=_):_=R[23],R[24]!==L?(b=L&&(0,l.jsx)(T,{details:L}),R[24]=L,R[25]=b):b=R[25],R[26]!==E.repoName||R[27]!==E.repoOwner?(y=(0,h.Do2)({name:E.repoName,ownerLogin:E.repoOwner}),R[26]=E.repoName,R[27]=E.repoOwner,R[28]=y):y=R[28],R[29]!==E.repoName||R[30]!==E.repoOwner||R[31]!==y?(w=(0,l.jsxs)(j.O.DetailLink,{href:y,icon:x.RepoIcon,children:[E.repoOwner,"/",E.repoName]}),R[29]=E.repoName,R[30]=E.repoOwner,R[31]=y,R[32]=w):w=R[32],R[33]!==$||R[34]!==L?.range||R[35]!==E.commitOID||R[36]!==E.path||R[37]!==E.repoName||R[38]!==E.repoOwner?(S=$&&(0,l.jsxs)(j.O.DetailLink,{icon:x.PeopleIcon,href:(0,h.buO)({owner:E.repoOwner,repo:E.repoName,commitish:E.commitOID,filePath:E.path,lineNumber:L?.range.start}),children:[$.totalCount," contributors"]}),R[33]=$,R[34]=L?.range,R[35]=E.commitOID,R[36]=E.path,R[37]=E.repoName,R[38]=E.repoOwner,R[39]=S):S=R[39],R[40]!==F||R[41]!==E.repoName||R[42]!==E.repoOwner?(N=F&&(0,l.jsxs)(j.O.DetailLink,{icon:x.HistoryIcon,href:(0,h.$Qz)({owner:E.repoOwner,repo:E.repoName,commitish:F?.oid}),children:[F?.author?.displayName," updated ",(0,l.jsx)(g.A,{datetime:F?.date})]}),R[40]=F,R[41]=E.repoName,R[42]=E.repoOwner,R[43]=N):N=R[43],R[44]!==L?(I=L?(0,l.jsxs)(l.Fragment,{children:["#",L.range.start,"-",L.range.end]}):null,R[44]=L,R[45]=I):I=R[45],R[46]!==E.path||R[47]!==E.repoName||R[48]!==E.repoOwner||R[49]!==E.url||R[50]!==I?(O=(0,l.jsxs)(j.O.DetailLink,{icon:x.LinkExternalIcon,href:E.url,children:[E.repoOwner,"/",E.repoName,"/",E.path,I]}),R[46]=E.path,R[47]=E.repoName,R[48]=E.repoOwner,R[49]=E.url,R[50]=I,R[51]=O):O=R[51],R[52]!==w||R[53]!==S||R[54]!==N||R[55]!==O?(k=(0,l.jsxs)(j.O.Details,{children:[w,S,N,O]}),R[52]=w,R[53]=S,R[54]=N,R[55]=O,R[56]=k):k=R[56],R[57]!==B||R[58]!==P||R[59]!==b||R[60]!==k?(A=(0,l.jsxs)(j.O.Body,{detailsLoading:P,detailsError:B,children:[b,k]}),R[57]=B,R[58]=P,R[59]=b,R[60]=k,R[61]=A):A=R[61],R[62]!==_||R[63]!==A?(D=(0,l.jsxs)(j.O.Frame,{children:[_,A]}),R[62]=_,R[63]=A,R[64]=D):D=R[64],D}function T(c){let e,a,t,r,o,i,s,m,z,d,h,p,u,M,f,x,g=(0,n.c)(52),{details:v}=c,[b,y]=(0,_.useState)(v.range.start),[w,O]=(0,_.useState)(v.range.end),k=V(v.contents,v.contents.length),[A,R]=(0,_.useState)("preview");g[0]!==A?(e=c=>{let e=["preview","code"][c];e&&A!==e&&R(e)},g[0]=A,g[1]=e):e=g[1];let P=e,T=v?.headerInfo;g[2]!==v.contents||g[3]!==b?(a=()=>{y(function(c,e){let a=$(c,e),t=function(c){let e;for(let a of c)e=a;return e}(c.slice(0,a).matchAll(/^#+\s/gm));return V(c,t?.index??0)}(v.contents,b))},g[2]=v.contents,g[3]=b,g[4]=a):a=g[4];let F=a;g[5]!==v.contents||g[6]!==w||g[7]!==k?(t=()=>{let c=w;for(;c-1&&(W=W.slice(c.startIndex,c.endIndex)),g[9]=w,g[10]=W,g[11]=b,g[12]=W}else W=g[12];if(g[13]!==W){let e;g[15]===Symbol.for("react.memo_cache_sentinel")?(e=/^---\n[\s\S]*?\n---\n/,g[15]=e):e=g[15],c=W.replace(e,""),g[13]=W,g[14]=c}else c=g[14];W=c}let U=W;g[16]===Symbol.for("react.memo_cache_sentinel")?(r={border:"1px solid var(--borderColor-default, var(--color-border-default))",borderRadius:"6px 6px 0 0",marginX:3},g[16]=r):r=g[16],g[17]===Symbol.for("react.memo_cache_sentinel")?(o={display:"flex",alignItems:"baseline",gap:2},g[17]=o):o=g[17];let q="preview"===A;g[18]!==q?(i=(0,l.jsx)(E.I.Button,{selected:q,children:"Preview"},"preview'"),g[18]=q,g[19]=i):i=g[19];let G="code"===A;return g[20]!==G?(s=(0,l.jsx)(E.I.Button,{selected:G,children:"Code"},"raw"),g[20]=G,g[21]=s):s=g[21],g[22]!==P||g[23]!==i||g[24]!==s?(m=(0,l.jsxs)(E.I,{"aria-label":"File view",size:"small",onChange:P,className:L.SegmentedControl,children:[i,s]}),g[22]=P,g[23]=i,g[24]=s,g[25]=m):m=g[25],g[26]!==T?(z=T&&(0,l.jsx)(N,{headerInfo:T}),g[26]=T,g[27]=z):z=g[27],g[28]!==m||g[29]!==z?(d=(0,l.jsxs)(C.az,{sx:o,children:[m,z]}),g[28]=m,g[29]=z,g[30]=d):d=g[30],g[31]!==T?(h=T&&(0,l.jsx)(I,{headerInfo:T}),g[31]=T,g[32]=h):h=g[32],g[33]!==d||g[34]!==h?(p=(0,l.jsxs)(S,{children:[d,h]}),g[33]=d,g[34]=h,g[35]=p):p=g[35],g[36]!==F||g[37]!==b?(u=b>1&&(0,l.jsx)(j.O.ContentExpander,{direction:"above",onExpand:F}),g[36]=F,g[37]=b,g[38]=u):u=g[38],g[39]!==v.contents||g[40]!==A||g[41]!==U?(M=(0,l.jsx)(j.O.Content,{children:"preview"===A?(0,l.jsx)(C.az,{className:"js-snippet-clipboard-copy-unpositioned",sx:{".highlighted":{backgroundColor:B}},children:(0,l.jsx)(D.To,{markdown:U,openLinksInCurrentTab:!1})}):(0,l.jsx)("code",{children:(0,l.jsx)(C.az,{as:"pre",sx:{overflowX:"auto"},children:v.contents})})}),g[39]=v.contents,g[40]=A,g[41]=U,g[42]=M):M=g[42],g[43]!==w||g[44]!==H||g[45]!==k?(f=w0,_=u.size>0,b=[...p.values()].length,y=[...p.values()].reduce(J,0),w=[...u.values()].length,S=[...u.values()].reduce(G,0),{contributors:N}=(0,M.u)(v?.repoOwner,v?.repoName,v?.commitOID,v?.path),[I]=(0,f.E)(v?.repoOwner,v?.repoName,v?.commitOID,v?.path),O=j.O;o[0]!==d||o[1]!==i.name?(e=(0,l.jsx)(j.O.Header,{onDismiss:d,children:i.name}),o[0]=d,o[1]=i.name,o[2]=e):e=o[2];let k=j.O,A=C&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(j.O.SectionDivider,{children:[y," ",1===y?"definition":"definitions",b>1?` across ${b} files`:null]}),[...p.values()].map(U)]}),D=_&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(j.O.SectionDivider,{children:[S," ",1===S?"reference":"references",w>1?` across ${w} files`:null]}),[...u.values()].map((c,e)=>(0,l.jsx)(j.O.CollapsibleSubsection,{title:c[0].path,initiallyOpen:0===e&&!C,children:(0,l.jsx)(j.O.Content,{children:c.map(W)})},c[0].path))]}),R=j.O,E=v&&(0,l.jsxs)(j.O.DetailLink,{href:(0,h.Do2)({name:v.repoName,ownerLogin:v.repoOwner}),icon:x.RepoIcon,children:[v.repoOwner,"/",v.repoName]}),L=N&&v&&(0,l.jsxs)(j.O.DetailLink,{icon:x.PeopleIcon,href:(0,h.buO)({owner:v.repoOwner,repo:v.repoName,commitish:v.commitOID,filePath:v.path}),children:[N.totalCount," ",1===N.totalCount?"contributor":"contributors"]}),P=I&&v&&(0,l.jsxs)(j.O.DetailLink,{icon:x.HistoryIcon,href:(0,h.$Qz)({owner:v.repoOwner,repo:v.repoName,commitish:I?.oid}),children:[I?.author?.displayName," updated ",(0,l.jsx)(g.A,{datetime:I?.date})]}),T=v&&(0,l.jsxs)(j.O.DetailLink,{icon:x.LinkExternalIcon,href:(0,h.nD_)({owner:v.repoOwner,repo:v.repoName,commitish:v.commitOID,filePath:v.path}),children:[v.repoOwner,"/",v.repoName,"/",v.path]});return o[3]!==T||o[4]!==R.Details||o[5]!==E||o[6]!==L||o[7]!==P?(a=(0,l.jsxs)(R.Details,{children:[E,L,P,T]}),o[3]=T,o[4]=R.Details,o[5]=E,o[6]=L,o[7]=P,o[8]=a):a=o[8],o[9]!==z||o[10]!==m||o[11]!==a||o[12]!==k.Body||o[13]!==A||o[14]!==D?(t=(0,l.jsxs)(k.Body,{detailsError:z,detailsLoading:m,children:[A,D,a]}),o[9]=z,o[10]=m,o[11]=a,o[12]=k.Body,o[13]=A,o[14]=D,o[15]=t):t=o[15],o[16]!==O.Frame||o[17]!==t||o[18]!==e?(r=(0,l.jsxs)(O.Frame,{children:[e,t]}),o[16]=O.Frame,o[17]=t,o[18]=e,o[19]=r):r=o[19],r}function W(c,e){return c.highlightedContents?(0,l.jsx)(y,{trimLineBeginnings:1===c.highlightedContents.length,lines:c.highlightedContents,lineNumbers:K(c)},e):null}function U(c,e){return(0,l.jsx)(j.O.CollapsibleSubsection,{title:c[0].path,initiallyOpen:0===e,children:(0,l.jsx)(j.O.Content,{children:c.map(q)})},c[0].path)}function q(c,e){return c.highlightedContents?(0,l.jsx)(y,{trimLineBeginnings:1===c.highlightedContents.length,lines:c.highlightedContents,lineNumbers:K(c)},e):null}function G(c,e){return c+e.length}function J(c,e){return c+e.length}function K({range:c}){return c?Array(c.end-c.start+1).fill(null).map((e,a)=>c.start+a):[]}try{H.displayName||(H.displayName="SymbolReferencePreview")}catch{}function Y(c){let e,a,t,r,o,i,s,m,z,p,u,v,_,b,y=(0,n.c)(48),{reference:w,details:S,detailsLoading:N,detailsError:I,onDismiss:O}=c,k=w.headFile??w.baseFile,{contributors:A}=(0,M.u)(k.repoOwner,k.repoName,k.commitOID,k.path),[D]=(0,f.E)(k.repoOwner,k.repoName,k.commitOID,k.path);y[0]!==w?(e=(c=>{let e,a=(e=c.selectedRange,e?.start?e.end?`${e.start}-${e.end}`:`${e.start}`:""),t=c.url.split(window.location.host)[1];return{href:c.url+a,path:t+a,range:a}})(w),y[0]=w,y[1]=e):e=y[1];let{href:R,path:E,range:L}=e,P=S?.repoIsOrgOwned,T=`${k.repoOwner}.png`;return y[2]===Symbol.for("react.memo_cache_sentinel")?(a={mr:2,flexShrink:0},y[2]=a):a=y[2],y[3]!==P||y[4]!==T?(t=(0,l.jsx)(d.r,{square:P,src:T,sx:a}),y[3]=P,y[4]=T,y[5]=t):t=y[5],y[6]===Symbol.for("react.memo_cache_sentinel")?(r={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},y[6]=r):r=y[6],y[7]!==k.path||y[8]!==k.repoName||y[9]!==k.repoOwner||y[10]!==L?(o=(0,l.jsxs)(C.az,{sx:r,children:[k.repoOwner,"/",k.repoName,"/",k.path," ",L]}),y[7]=k.path,y[8]=k.repoName,y[9]=k.repoOwner,y[10]=L,y[11]=o):o=y[11],y[12]!==O||y[13]!==t||y[14]!==o?(i=(0,l.jsxs)(j.O.Header,{onDismiss:O,children:[t,o]}),y[12]=O,y[13]=t,y[14]=o,y[15]=i):i=y[15],y[16]!==k.repoName||y[17]!==k.repoOwner?(s=(0,h.Do2)({name:k.repoName,ownerLogin:k.repoOwner}),y[16]=k.repoName,y[17]=k.repoOwner,y[18]=s):s=y[18],y[19]!==k.repoName||y[20]!==k.repoOwner||y[21]!==s?(m=(0,l.jsxs)(j.O.DetailLink,{href:s,icon:x.RepoIcon,children:[k.repoOwner,"/",k.repoName]}),y[19]=k.repoName,y[20]=k.repoOwner,y[21]=s,y[22]=m):m=y[22],y[23]!==k.commitOID||y[24]!==k.path||y[25]!==k.repoName||y[26]!==k.repoOwner||y[27]!==A?(z=A&&(0,l.jsxs)(j.O.DetailLink,{icon:x.PeopleIcon,href:(0,h.buO)({owner:k.repoOwner,repo:k.repoName,commitish:k.commitOID,filePath:k.path}),children:[A.totalCount," ",1===A.totalCount?"contributor":"contributors"]}),y[23]=k.commitOID,y[24]=k.path,y[25]=k.repoName,y[26]=k.repoOwner,y[27]=A,y[28]=z):z=y[28],y[29]!==k.repoName||y[30]!==k.repoOwner||y[31]!==D?(p=D&&(0,l.jsxs)(j.O.DetailLink,{icon:x.HistoryIcon,href:(0,h.$Qz)({owner:k.repoOwner,repo:k.repoName,commitish:D?.oid}),children:[D?.author?.displayName," updated ",(0,l.jsx)(g.A,{datetime:D?.date})]}),y[29]=k.repoName,y[30]=k.repoOwner,y[31]=D,y[32]=p):p=y[32],y[33]!==R||y[34]!==E?(u=(0,l.jsx)(j.O.DetailLink,{icon:x.LinkExternalIcon,href:R,children:E}),y[33]=R,y[34]=E,y[35]=u):u=y[35],y[36]!==m||y[37]!==z||y[38]!==p||y[39]!==u?(v=(0,l.jsxs)(j.O.Details,{children:[m,z,p,u]}),y[36]=m,y[37]=z,y[38]=p,y[39]=u,y[40]=v):v=y[40],y[41]!==I||y[42]!==N||y[43]!==v?(_=(0,l.jsx)(j.O.Body,{detailsError:I,detailsLoading:N,children:v}),y[41]=I,y[42]=N,y[43]=v,y[44]=_):_=y[44],y[45]!==_||y[46]!==i?(b=(0,l.jsxs)(j.O.Frame,{children:[i,_]}),y[45]=_,y[46]=i,y[47]=b):b=y[47],b}try{Y.displayName||(Y.displayName="FileDiffReferencePreview")}catch{}var Q=a(41738);function X(c){let e,a=(0,n.c)(6),{dismissable:t}=c,{reference:r,details:o,detailsLoading:i,detailsError:s,dismissReference:m}=cc(),z=t?m:void 0;return a[0]!==o||a[1]!==s||a[2]!==i||a[3]!==r||a[4]!==z?(e=(0,l.jsx)(Z,{reference:r,details:o,detailsLoading:i,detailsError:s,onDismiss:z}),a[0]=o,a[1]=s,a[2]=i,a[3]=r,a[4]=z,a[5]=e):e=a[5],e}function Z(c){let e=(0,n.c)(46),{reference:a,details:t,detailsLoading:r,detailsError:o,onDismiss:i}=c;switch(a.type){case"symbol":{let c,n;return e[0]!==a?(c=(0,m.Vb)(a),e[0]=a,e[1]=c):c=e[1],e[2]!==o||e[3]!==r||e[4]!==i||e[5]!==a||e[6]!==c||e[7]!==t?(n=(0,l.jsx)(H,{reference:a,details:t,detailsLoading:r,detailsError:o,onDismiss:i},c),e[2]=o,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=t,e[8]=n):n=e[8],n}case"file":case"snippet":{let c;return e[9]!==t||e[10]!==o||e[11]!==r||e[12]!==i||e[13]!==a?(c="Markdown"===a.languageName?(0,l.jsx)(P,{reference:a,details:t,detailsError:o,detailsLoading:r,onDismiss:i},(0,m.Vb)(a)):(0,l.jsx)(w,{reference:a,details:t,detailsLoading:r,detailsError:o,onDismiss:i},(0,m.Vb)(a)),e[9]=t,e[10]=o,e[11]=r,e[12]=i,e[13]=a,e[14]=c):c=e[14],c}case"file-diff":{let c,n;return e[15]!==a?(c=(0,m.Vb)(a),e[15]=a,e[16]=c):c=e[16],e[17]!==o||e[18]!==r||e[19]!==i||e[20]!==a||e[21]!==c||e[22]!==t?(n=(0,l.jsx)(Y,{reference:a,details:t,detailsLoading:r,detailsError:o,onDismiss:i},c),e[17]=o,e[18]=r,e[19]=i,e[20]=a,e[21]=c,e[22]=t,e[23]=n):n=e[23],n}case"commit":{let c,t;return e[24]!==a?(c=(0,m.Vb)(a),e[24]=a,e[25]=c):c=e[25],e[26]!==o||e[27]!==r||e[28]!==i||e[29]!==a||e[30]!==c?(t=(0,l.jsx)(R,{reference:a,detailsLoading:r,detailsError:o,onDismiss:i},c),e[26]=o,e[27]=r,e[28]=i,e[29]=a,e[30]=c,e[31]=t):t=e[31],t}case"pull-request":{let c,t;return e[32]!==a?(c=(0,m.Vb)(a),e[32]=a,e[33]=c):c=e[33],e[34]!==o||e[35]!==r||e[36]!==i||e[37]!==a||e[38]!==c?(t=(0,l.jsx)(F,{reference:a,detailsLoading:r,detailsError:o,onDismiss:i},c),e[34]=o,e[35]=r,e[36]=i,e[37]=a,e[38]=c,e[39]=t):t=e[39],t}case"web-search":{let c,t;return e[40]!==a?(c=(0,m.Vb)(a),e[40]=a,e[41]=c):c=e[41],e[42]!==i||e[43]!==a||e[44]!==c?(t=(0,l.jsx)(Q.I,{reference:a,onDismiss:i},c),e[42]=i,e[43]=a,e[44]=c,e[45]=t):t=e[45],t}default:return null}}function cc(){let c,e,a,t,l,r,o=(0,n.c)(19),d=(0,s.b)(),h=(0,i.Pk)().selectedReference,p=h?.type;o[0]!==h?(c=h?(0,m.Vb)(h):void 0,o[0]=h,o[1]=c):c=o[1],o[2]!==p||o[3]!==c?(e=["copilot-reference-preview","copilot","references",p,c],o[2]=p,o[3]=c,o[4]=e):e=o[4],o[5]!==d||o[6]!==h?(a=async()=>{if(!h)return null;let c=await d.service.hydrateReference(h);return c.ok?c.payload:null},o[5]=d,o[6]=h,o[7]=a):a=o[7],o[8]!==e||o[9]!==a?(t={queryKey:e,queryFn:a,staleTime:5e-324},o[8]=e,o[9]=a,o[10]=t):t=o[10];let{isLoading:u,isError:M,data:f}=(0,z.I)(t);o[11]!==d?(l=()=>d.selectReference(null),o[11]=d,o[12]=l):l=o[12];let x=l,g=f??void 0;return o[13]!==x||o[14]!==M||o[15]!==u||o[16]!==h||o[17]!==g?(r={reference:h,dismissReference:x,details:g,detailsLoading:u,detailsError:M},o[13]=x,o[14]=M,o[15]=u,o[16]=h,o[17]=g,o[18]=r):r=o[18],r}try{X.displayName||(X.displayName="CopilotReferencePreview")}catch{}try{Z.displayName||(Z.displayName="CopilotReferencePreviewImpl")}catch{}function ce(){var c;let e,a,t,i,s,m=(0,n.c)(13),{dismissReference:z,reference:d}=cc(),{screenSize:h}=(0,o.lm)(),p=h{let c,e,a=(0,n.c)(7),t=(0,i.Pk)(),r=(0,s.b)();a[0]!==t?(c=(0,cv.W)(t),a[0]=t,a[1]=c):c=a[1];let o=c;return a[2]!==r||a[3]!==t.chatVisibleSettingPath||a[4]!==t.currentView||a[5]!==o?(e=(0,l.jsx)(v.K,{tabIndex:-1,id:"copilot-floating-button",icon:x.CopilotIcon,"aria-label":"Open Copilot chat","aria-controls":cf.wJ,tooltipDirection:"w",onClick:()=>{r.openChat(o,t.currentView,"floating-button-v2",t.chatVisibleSettingPath)},"data-hotkey":"Shift+Z",className:c_.FloatingButtonContainer}),a[2]=r,a[3]=t.chatVisibleSettingPath,a[4]=t.currentView,a[5]=o,a[6]=e):e=a[6],e};try{cj.displayName||(cj.displayName="FloatingButton")}catch{}var cb=a(35673);let cy=c=>{let e,a,t,r,o,z,d,h=(0,n.c)(27),{children:p,initialFocusRef:u,staffDialogRef:M,handleClose:f,panelWidth:x,panelHeight:g,startResize:v,onResizerKeyDown:j}=c,b=(0,i.Pk)(),{chatIsOpen:y,chatIsVisible:w,currentTopic:S}=b,N=b.entryPointId??cf.fv,I=(0,_.useRef)(null),O=(0,_.useRef)(null);h[0]!==N?(e=()=>{O.current=document.getElementById(N)},a=[N],h[0]=N,h[1]=e,h[2]=a):(e=h[1],a=h[2]),(0,_.useEffect)(e,a),h[3]!==f?(t=()=>{I.current&&I.current.contains(document.activeElement)&&f(!0)},h[3]=f,h[4]=t):t=h[4];let k=t,A=(0,s.b)();h[5]!==b?(r=(0,cv.W)(b),h[5]=b,h[6]=r):r=h[6];let D=r,R=(0,cu.Z)();h[7]!==S||h[8]!==R||h[9]!==b.currentReferences||h[10]!==D?(o=()=>{(0,ct.BI)("dotcom_chat.activate",{target:"IMMERSIVE_OPTION",mode:"assistive"}),cg.Jt.setCurrentReferences(D?.id??null,b.currentReferences),D?R(`${m.Jz}/c/${D.id}`):S&&(0,m.Z6)(S)?R(`${m.Jz}/r/${S.ownerLogin}/${S.name}`):R(m.Jz)},h[7]=S,h[8]=R,h[9]=b.currentReferences,h[10]=D,h[11]=o):o=h[11];let E=o;return h[12]!==y||h[13]!==w||h[14]!==p||h[15]!==u||h[16]!==A||h[17]!==E||h[18]!==k||h[19]!==j||h[20]!==g||h[21]!==x||h[22]!==M||h[23]!==v?(z=y?(0,l.jsxs)(cM.Ay,{id:cf.wJ,className:(0,cm.$)(cC.copilotChatPanel,y&&cC.openChat),ref:I,portalContainerName:(0,ch.G7)("primer_react_unified_portal_root")?void 0:cb.Gj,onEscape:k,onClickOutside:cw,ignoreClickRefs:[M],initialFocusRef:u,returnFocusRef:O,style:{"--panel-width":`${x}px`,"--panel-height":`${g}px`,"--panel-min-height":`${cx.cx}px`,"--panel-min-width":`${cx.Ld}px`},right:8,bottom:8,anchorSide:"inside-top",position:"fixed",role:"dialog","aria-labelledby":cf.Qs,children:[(0,l.jsx)(cp.ak,{commands:{"copilot-chat:close-assistive":()=>A.closeChat()}}),(0,l.jsx)(cp.tL,{commands:{"copilot-chat:continue-in-immersive":E},children:(0,l.jsx)("section",{id:cf.Qs,"aria-label":"Copilot chat panel",style:{height:"100%"},children:(0,l.jsxs)("div",{"data-testid":cf.Qs,className:cC.ChatPanelContainer,children:[(0,l.jsx)(C.az,{id:"vertical-resize-click-target",sx:{cursor:y?"ns-resize":void 0},onMouseDown:c=>v(c,!1,!0),className:cC.verticalResizeTarget}),(0,l.jsx)(C.az,{sx:{cursor:y?"ew-resize":void 0},onMouseDown:c=>v(c,!0,!1),className:cC.horizontalResizeTarget}),(0,l.jsx)(C.az,{sx:{cursor:y?"nwse-resize":"undefined"},"aria-label":"Chat panel resizer","aria-valuetext":`${x}, ${g}`,"aria-valuenow":x,role:"separator",onMouseDown:c=>v(c,!0,!0),tabIndex:0,onKeyDown:j,className:cC.cornerResizeTarget}),(0,l.jsx)("div",{className:cC.panelContentContainer,children:p})]})})})]}):w&&!(0,ch.G7)("copilot_no_floating_button")?(0,l.jsx)(cj,{}):null,h[12]=y,h[13]=w,h[14]=p,h[15]=u,h[16]=A,h[17]=E,h[18]=k,h[19]=j,h[20]=g,h[21]=x,h[22]=M,h[23]=v,h[24]=z):z=h[24],h[25]!==z?(d=(0,l.jsx)(l.Fragment,{children:z}),h[25]=z,h[26]=d):d=h[26],d};try{cy.displayName||(cy.displayName="ChatPanel")}catch{}function cw(){}var cS=a(54589),cN=a(11083),cI=a(81960),cO=a(26607),ck=a(94236),cA=a(5524),cD=a(51213),cR=a(35247),cE=a(17005);let cL={HeaderContainer:"Header-module__HeaderContainer--rObkM",headerTitleContainer:"Header-module__headerTitleContainer--Dl484",HeaderTitle:"Header-module__HeaderTitle--fAPdx",headerActions:"Header-module__headerActions--YEgVs",betaLabel:"Header-module__betaLabel--oV8Ou",actionButton:"Header-module__actionButton--Zt7jn",buttonSeparator:"Header-module__buttonSeparator--W8lbr"};var cP=a(87255),cT=a(86877),cB=a(57352),cV=a(99511),c$=a(56149),cF=a(15220),cH=a(44902);let cW={dialogContentContainer:"ExperimentsDialog-module__dialogContentContainer--mWDus",experimentsInput:"ExperimentsDialog-module__experimentsInput--Uko5H"},cU=c=>{let e,a,t,r,o,i,s,m,z,d,h,p,u,M=(0,n.c)(29),{onDismiss:f,experimentsDialogRef:x}=c,[g,v]=(0,_.useState)(cq),[C,j]=(0,_.useState)(void 0),b=(0,_.useRef)("\u200B");M[0]!==g||M[1]!==f?(e=()=>{let c=[];for(let e of g.split(","))if(""!==e.trim()){if(2!==e.split("=").length){j(`Invalid experiment key=value pair${b.current}`),b.current=b.current+"\u200B";return}j(""),c.push(e)}(0,cH.R)(c),f()},M[0]=g,M[1]=f,M[2]=e):e=M[2];let y=e;return M[3]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsx)(cT.A.Label,{children:"Experiments"}),M[3]=a):a=M[3],M[4]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)("code",{children:"key=value"}),M[4]=t):t=M[4],M[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)(cT.A.Caption,{children:(0,l.jsxs)("span",{children:["List experiments as comma separated ",t," pairs. To see available experiments,"," ",(0,l.jsx)(cB.A,{inline:!0,target:"_blank",href:`/search?q=${encodeURIComponent("repo:github/copilot-api path:experiments.go")}`,children:"read this code"}),"."]})}),M[5]=r):r=M[5],M[6]===Symbol.for("react.memo_cache_sentinel")?(o=c=>v(c.target.value),M[6]=o):o=M[6],M[7]!==y?(i=c=>{"Enter"===c.key&&y()},M[7]=y,M[8]=i):i=M[8],M[9]!==g||M[10]!==i?(s=(0,l.jsx)(cV.A,{"aria-label":"Experiments",name:"experiments",value:g,onChange:o,onKeyDown:i,className:cW.experimentsInput}),M[9]=g,M[10]=i,M[11]=s):s=M[11],M[12]!==C?(m=C&&(0,l.jsx)(cT.A.Validation,{variant:"error",children:C}),M[12]=C,M[13]=m):m=M[13],M[14]!==s||M[15]!==m?(z=(0,l.jsx)(cF.l.Body,{children:(0,l.jsx)("div",{className:cW.dialogContentContainer,children:(0,l.jsxs)(cT.A,{children:[a,r,s,m]})})}),M[14]=s,M[15]=m,M[16]=z):z=M[16],M[17]!==f?(d={type:"button",onClick:f,content:"Cancel"},M[17]=f,M[18]=d):d=M[18],M[19]!==y?(h={type:"button",onClick:y,content:"Save",buttonType:"primary"},M[19]=y,M[20]=h):h=M[20],M[21]!==d||M[22]!==h?(p=(0,l.jsx)(cF.l.Footer,{children:(0,l.jsx)(cF.l.Buttons,{buttons:[d,h]})}),M[21]=d,M[22]=h,M[23]=p):p=M[23],M[24]!==x||M[25]!==f||M[26]!==p||M[27]!==z?(u=(0,l.jsx)(c$.ZL,{children:(0,l.jsxs)(cF.l,{ref:x,onClose:f,title:"Experiments",width:"xlarge",children:[z,p]})}),M[24]=x,M[25]=f,M[26]=p,M[27]=z,M[28]=u):u=M[28],u};try{cU.displayName||(cU.displayName="ExperimentsDialog")}catch{}function cq(){return(0,cH.f)().join(",")}var cG=a(4175),cJ=a(46251),cK=a(44534);let cY={Dialog:"PromptDialog-module__Dialog--gvqi7",systemInstructionsTextarea:"PromptDialog-module__systemInstructionsTextarea--JIAZO",temperatureFormControl:"PromptDialog-module__temperatureFormControl--oJoQJ",toolsSectionHeader:"PromptDialog-module__toolsSectionHeader--jFBxE",deleteToolButton:"PromptDialog-module__deleteToolButton--PRDPZ"},cQ=c=>{let e,a,t,r,o,i,m,z,d,h,p,u,M,f,g,C,j,b,y,w,S,N,I,O=(0,n.c)(53),{onDismiss:k,promptDialogRef:A}=c,D=(0,s.b)(),R=cg.Jt.settings,[E,L]=(0,_.useState)(R?.instructionPrompt||void 0);O[0]===Symbol.for("react.memo_cache_sentinel")?(e=R?.skillOverrides??[],O[0]=e):e=O[0];let[P,T]=(0,_.useState)(e),[B,V]=(0,_.useState)(R?.temperature||.7),$=(0,_.useRef)(void 0);O[1]!==D||O[2]!==k||O[3]!==E||O[4]!==B||O[5]!==P?(a=()=>{let c=P.filter(cX);D.setCopilotSettings({instructionPrompt:E||"",skillOverrides:c,temperature:B}),k()},O[1]=D,O[2]=k,O[3]=E,O[4]=B,O[5]=P,O[6]=a):a=O[6];let F=a;O[7]!==D?(t=async()=>{if($.current)return void L($.current);let c=await D.getSystemPrompt();$.current=c,L(c)},O[7]=D,O[8]=t):t=O[8];let H=t;O[9]!==H||O[10]!==E?(r=()=>{(async()=>{void 0===E&&await H()})()},O[9]=H,O[10]=E,O[11]=r):r=O[11],O[12]!==H||O[13]!==D||O[14]!==E?(o=[H,D,E],O[12]=H,O[13]=D,O[14]=E,O[15]=o):o=O[15],(0,_.useEffect)(r,o),O[16]!==H?(i=()=>{H(),T([]),V(.7)},O[16]=H,O[17]=i):i=O[17];let W=i;return O[18]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)(cT.A.Label,{children:"System Instructions"}),O[18]=m):m=O[18],O[19]===Symbol.for("react.memo_cache_sentinel")?(z=(0,l.jsx)(cT.A.Caption,{children:(0,l.jsx)("span",{children:"Make adjustments to the system instructions or add new instructions."})}),O[19]=z):z=O[19],O[20]===Symbol.for("react.memo_cache_sentinel")?(d=c=>L(c.target.value),O[20]=d):d=O[20],O[21]!==E?(h=(0,l.jsxs)(cT.A,{children:[m,z,(0,l.jsx)(cG.Ay,{block:!0,"aria-label":"Prompt",name:"Prompt",value:E,onChange:d,className:cY.systemInstructionsTextarea})]}),O[21]=E,O[22]=h):h=O[22],O[23]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.jsx)(cT.A.Label,{children:"Temperature"}),u=(0,l.jsx)(cT.A.Caption,{children:"Controls the randomness of the model's responses. Lower temperatures are more deterministic, while higher temperatures are more random."}),O[23]=p,O[24]=u):(p=O[23],u=O[24]),O[25]===Symbol.for("react.memo_cache_sentinel")?(M=c=>V(Number(c.target.value)),O[25]=M):M=O[25],O[26]!==B?(f=(0,l.jsxs)(cT.A,{className:cY.temperatureFormControl,children:[p,u,(0,l.jsx)(cV.A,{type:"number",min:"0",max:"1",step:"0.01",block:!0,value:B,onChange:M})]}),O[26]=B,O[27]=f):f=O[27],O[28]===Symbol.for("react.memo_cache_sentinel")?(g=(0,l.jsx)("div",{className:cY.toolsSectionHeader,children:"Tools"}),O[28]=g):g=O[28],O[29]!==P?(C=P.map((c,e)=>(0,l.jsxs)(_.Fragment,{children:[(0,l.jsxs)(cJ.B,{direction:"horizontal",className:"py-2",children:[(0,l.jsxs)(cT.A,{children:[(0,l.jsx)(cT.A.Label,{children:"Name"}),(0,l.jsx)(cT.A.Caption,{children:(0,l.jsx)("span",{children:"Slug of tool you want to adjust"})}),(0,l.jsx)(cV.A,{defaultValue:c.slug,onChange:c=>{P.map((a,t)=>{t===e&&(a.slug=c.target.value)})}})]}),(0,l.jsxs)(cT.A,{children:[(0,l.jsx)(cT.A.Label,{children:"Description"}),(0,l.jsx)(cT.A.Caption,{children:(0,l.jsx)("span",{children:"Make changes to the tool description"})}),(0,l.jsx)(cV.A,{defaultValue:c.description,onChange:a=>{P.map((t,l)=>{l===e&&(c.description=a.target.value)})}})]}),(0,l.jsxs)(cT.A,{children:[(0,l.jsx)(cT.A.Label,{id:"toggle",children:"Enabled?"}),(0,l.jsx)(cK.A,{size:"small","aria-labelledby":"toggle",defaultChecked:c.enabled,onChange:c=>{P.map((a,t)=>{t===e&&(a.enabled=c)})}})]}),(0,l.jsx)(v.K,{icon:x.TrashIcon,"aria-label":"Delete tool",variant:"invisible",onClick:()=>{let c=[...P];1===P.length?T([]):(c.splice(e,1),T(c))},className:cY.deleteToolButton})]}),e===P.length-1&&(0,l.jsx)(ci.Q,{leadingVisual:(0,l.jsx)(x.PlusIcon,{}),onClick:()=>T([...P,{slug:"",description:"",enabled:!0}]),variant:"invisible",size:"small",children:"Add another tool"})]},`tool-${c.slug}-${Math.random()}`)),O[29]=P,O[30]=C):C=O[30],O[31]!==P?(j=0===P.length&&(0,l.jsx)(ci.Q,{leadingVisual:(0,l.jsx)(x.PlusIcon,{}),onClick:()=>T([...P,{slug:"",description:"",enabled:!0}]),variant:"invisible",size:"small",children:"Add a tool"}),O[31]=P,O[32]=j):j=O[32],O[33]!==h||O[34]!==f||O[35]!==C||O[36]!==j?(b=(0,l.jsxs)(cF.l.Body,{children:[h,f,g,C,j]}),O[33]=h,O[34]=f,O[35]=C,O[36]=j,O[37]=b):b=O[37],O[38]!==k?(y={type:"button",onClick:k,content:"Cancel"},O[38]=k,O[39]=y):y=O[39],O[40]!==W?(w={type:"button",onClick:W,content:"Reset"},O[40]=W,O[41]=w):w=O[41],O[42]!==F?(S={type:"button",onClick:F,content:"Save",buttonType:"primary"},O[42]=F,O[43]=S):S=O[43],O[44]!==y||O[45]!==w||O[46]!==S?(N=(0,l.jsx)(cF.l.Footer,{children:(0,l.jsx)(cF.l.Buttons,{buttons:[y,w,S]})}),O[44]=y,O[45]=w,O[46]=S,O[47]=N):N=O[47],O[48]!==k||O[49]!==A||O[50]!==b||O[51]!==N?(I=(0,l.jsx)(c$.ZL,{children:(0,l.jsxs)(cF.l,{ref:A,onClose:k,title:"Prompt Settings",width:"xlarge",className:cY.Dialog,children:[b,N]})}),O[48]=k,O[49]=A,O[50]=b,O[51]=N,O[52]=I):I=O[52],I};try{cQ.displayName||(cQ.displayName="PromptDialog")}catch{}function cX(c){return c.slug&&c.description}let cZ=c=>{let e,a,t,r=(0,n.c)(11),{dialogType:o,onDismiss:i,staffDialogRef:s}=c;return r[0]!==o||r[1]!==i||r[2]!==s?(e=o===cD.hs.Experiments&&(0,l.jsx)(cU,{experimentsDialogRef:s,onDismiss:i}),r[0]=o,r[1]=i,r[2]=s,r[3]=e):e=r[3],r[4]!==o||r[5]!==i||r[6]!==s?(a=o===cD.hs.Prompt&&(0,l.jsx)(cQ,{promptDialogRef:s,onDismiss:i}),r[4]=o,r[5]=i,r[6]=s,r[7]=a):a=r[7],r[8]!==e||r[9]!==a?(t=(0,l.jsxs)(l.Fragment,{children:[e,a]}),r[8]=e,r[9]=a,r[10]=t):t=r[10],t};try{cZ.displayName||(cZ.displayName="StaffDialogs")}catch{}let c1=c=>{let e,a,t,r,o,m,z,d,h,p,u,M,f,g,j=(0,n.c)(54),b=(0,i.Pk)(),y=(0,s.b)(),[w,S]=(0,_.useState)(!1);j[0]!==b?(e=(0,cv.W)(b),j[0]=b,j[1]=e):e=j[1];let N=e,{showTopicPicker:I,messages:O,streamingMessage:k}=b,A=N?.name??b.restoredThreadTitle;j[2]!==y||j[3]!==N?(a=async()=>N&&y.deleteThread(N),j[2]=y,j[3]=N,j[4]=a):a=j[4];let D=a;j[5]===Symbol.for("react.memo_cache_sentinel")?(t=(0,ch.G7)("lifecycle_label_name_updates"),j[5]=t):t=j[5];let R=t;j[6]===Symbol.for("react.memo_cache_sentinel")?(r=(0,ch.G7)("copilot_no_floating_button"),j[6]=r):r=j[6];let E=r,L=(0,_.useRef)(null),P="immersive"===b.mode?1:3,T=I?"none":"1px solid";return j[7]!==P||j[8]!==T?(o={pl:P,borderBottom:T},j[7]=P,j[8]=T,j[9]=o):o=j[9],j[10]!==O||j[11]!==c.isImmersive||j[12]!==c.isResponding||j[13]!==I||j[14]!==b.chatIsOpen||j[15]!==b.currentView||j[16]!==A?(m="thread"===b.currentView?!I&&!c.isImmersive&&0===O.length&&b.chatIsOpen&&(0,l.jsx)(cI.A,{as:"h2",className:cL.HeaderTitle,children:"thread"===b.currentView?(0,l.jsx)(l.Fragment,{children:A?(0,l.jsx)("span",{className:"Truncate",children:(0,l.jsx)("span",{className:"Truncate-text",title:A,children:A})}):c.isResponding&&!b.chatIsOpen?(0,l.jsx)(l.Fragment,{children:"Responding\u2026"}):b.chatIsOpen?!I&&(0,l.jsx)(l.Fragment,{children:"New conversation"}):(0,l.jsx)(l.Fragment,{children:"Ask Copilot"})}):"Copilot"}):(0,l.jsx)(c0,{}),j[10]=O,j[11]=c.isImmersive,j[12]=c.isResponding,j[13]=I,j[14]=b.chatIsOpen,j[15]=b.currentView,j[16]=A,j[17]=m):m=j[17],j[18]!==m?(z=(0,l.jsx)("div",{className:cL.headerTitleContainer,children:m}),j[18]=m,j[19]=z):z=j[19],j[20]!==D||j[21]!==y||j[22]!==O||j[23]!==c.setShowStaffDialog||j[24]!==b.chatIsOpen||j[25]!==b.currentView||j[26]!==b.renderBetaLabel||j[27]!==N?(d=b.chatIsOpen&&(0,l.jsxs)(l.Fragment,{children:[b.renderBetaLabel&&(R?(0,l.jsx)(cS.X,{className:"mr-2"}):(0,l.jsx)(cO.A,{variant:"success",className:cL.betaLabel,children:"Beta"})),"thread"===b.currentView?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.K,{hidden:0===O.length,variant:"invisible",icon:x.PlusIcon,"aria-label":"New conversation",tooltipDirection:"s",onClick:async()=>{await y.selectThread(null)},className:cL.actionButton}),(0,l.jsx)(c2,{anchorRef:L,handleDelete:D,thread:N,setShowStaffDialog:c.setShowStaffDialog,setShowPersonalInstructionsDialog:S})]}):(0,l.jsx)(v.K,{variant:"invisible",icon:x.PlusIcon,"aria-label":"New conversation",tooltipDirection:"w",onClick:async()=>{await y.selectThread(null)},className:cL.actionButton})]}),j[20]=D,j[21]=y,j[22]=O,j[23]=c.setShowStaffDialog,j[24]=b.chatIsOpen,j[25]=b.currentView,j[26]=b.renderBetaLabel,j[27]=N,j[28]=d):d=j[28],j[29]!==y||j[30]!==c.isImmersive||j[31]!==b.chatIsOpen||j[32]!==b.chatVisibleSettingPath||j[33]!==b.currentView||j[34]!==k||j[35]!==N?(h=!c.isImmersive&&(0,l.jsxs)(l.Fragment,{children:[b.chatIsOpen&&(0,l.jsx)("div",{className:cL.buttonSeparator}),(0,l.jsx)(cp.N5,{commandId:"copilot-chat:continue-in-immersive",variant:"invisible",icon:x.ScreenFullIcon,"aria-label":"Continue in immersive",disabled:!!k,tooltipDirection:"sw",className:cL.actionButton}),E?(0,l.jsx)(cp.N5,{commandId:"copilot-chat:close-assistive",variant:"invisible",icon:x.XIcon,tooltipDirection:"sw",className:cL.actionButton}):(0,l.jsx)(v.K,{variant:"invisible",icon:b.chatIsOpen?x.ChevronDownIcon:x.ChevronUpIcon,"aria-label":b.chatIsOpen?"Collapse":"Expand",tooltipDirection:b.chatIsOpen?"sw":"w",onClick:b.chatIsOpen?()=>y.closeChat():()=>y.openChat(N,b.currentView,"header",b.chatVisibleSettingPath),"data-hotkey":"Shift+Z",className:cL.actionButton})]}),j[29]=y,j[30]=c.isImmersive,j[31]=b.chatIsOpen,j[32]=b.chatVisibleSettingPath,j[33]=b.currentView,j[34]=k,j[35]=N,j[36]=h):h=j[36],j[37]!==h||j[38]!==d?(p=(0,l.jsxs)("div",{className:cL.headerActions,children:[d,h]}),j[37]=h,j[38]=d,j[39]=p):p=j[39],j[40]!==c?(u=()=>c.setShowStaffDialog(cD.hs.None),j[40]=c,j[41]=u):u=j[41],j[42]!==c.showStaffDialog||j[43]!==c.staffDialogRef||j[44]!==u?(M=(0,l.jsx)(cZ,{dialogType:c.showStaffDialog,staffDialogRef:c.staffDialogRef,onDismiss:u}),j[42]=c.showStaffDialog,j[43]=c.staffDialogRef,j[44]=u,j[45]=M):M=j[45],j[46]!==w?(f=w&&(0,l.jsx)(cP.Y,{returnFocusRef:L,onDismiss:()=>S(!1)}),j[46]=w,j[47]=f):f=j[47],j[48]!==p||j[49]!==M||j[50]!==f||j[51]!==o||j[52]!==z?(g=(0,l.jsxs)(C.az,{sx:o,className:cL.HeaderContainer,children:[z,p,M,f]}),j[48]=p,j[49]=M,j[50]=f,j[51]=o,j[52]=z,j[53]=g):g=j[53],g},c0=()=>{let c,e,a,t=(0,n.c)(7),{mode:r}=(0,i.Pk)(),o=(0,s.b)();t[0]!==o?(c=()=>o.viewCurrentThread(),t[0]=o,t[1]=c):c=t[1];let m="assistive"===r?"-8px":void 0;return t[2]!==m?(e={marginLeft:m},t[2]=m,t[3]=e):e=t[3],t[4]!==c||t[5]!==e?(a=(0,l.jsx)(C.$n,{leadingVisual:x.ArrowLeftIcon,variant:"invisible",onClick:c,sx:e,className:cL.actionButton,children:"Back"}),t[4]=c,t[5]=e,t[6]=a):a=t[6],a},c2=c=>{let e,a,t,r,o,z,d,h,p,u,M,f,g,C,j,b,y,w,S,N,I,O,k,A,D,R=(0,n.c)(54),[E,L]=(0,_.useState)(!1),{chatVisibleSettingPath:P,mode:T,repoCustomInstructionsEnabled:B,currentReferences:V}=(0,i.Pk)(),$=(0,s.b)(),F=(0,_.useRef)(null);R[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,ch.G7)("copilot_no_floating_button"),R[0]=e):e=R[0];let H=e,W=cR.W.staffPromptDialog;R[1]!==V?(a=(0,m.NJ)(V),R[1]=V,R[2]=a):a=R[2];let U=a;R[3]!==$?(t=()=>{$.fetchThreads(),$.viewAllThreads(),(0,ct.BI)("copilot.view-conversations-clicked")},R[3]=$,R[4]=t):t=R[4];let q=t;R[5]!==c?(r=()=>{c.handleDelete(),L(!1)},R[5]=c,R[6]=r):r=R[6];let G=r;R[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,cN.X)(),R[7]=o):o=R[7];let J=o,K=!c.thread;R[8]===Symbol.for("react.memo_cache_sentinel")?(z=()=>L(c3),R[8]=z):z=R[8],R[9]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(ck.W.Anchor,{children:(0,l.jsx)(v.K,{icon:x.KebabHorizontalIcon,variant:"invisible","aria-label":"Conversation options",tooltipDirection:"n",className:cL.actionButton})}),R[9]=d):d=R[9],R[10]!==U.length||R[11]!==$||R[12]!==B?(h=U.length>0&&(0,l.jsxs)(cA.l.Item,{onSelect:()=>{$.toggleRepoCustomInstructions(!B)},children:[(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.NoteIcon,{})}),B?"Disable custom instructions":"Enable custom instructions"]}),R[10]=U.length,R[11]=$,R[12]=B,R[13]=h):h=R[13];let Y=K?"default":"danger";return R[14]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.TrashIcon,{})}),R[14]=p):p=R[14],R[15]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsx)("p",{id:"delete-conversation-description",className:"sr-only",children:"This is a destructive action that cannot be undone"}),R[15]=u):u=R[15],R[16]!==K||R[17]!==G||R[18]!==Y?(M=(0,l.jsxs)(cA.l.Item,{variant:Y,onSelect:G,disabled:K,"aria-describedby":"delete-conversation-description",children:[p,"Delete conversation",u]}),R[16]=K,R[17]=G,R[18]=Y,R[19]=M):M=R[19],R[20]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsx)(cA.l.Divider,{}),R[20]=f):f=R[20],R[21]!==c?(g=()=>c.setShowPersonalInstructionsDialog(!0),R[21]=c,R[22]=g):g=R[22],R[23]===Symbol.for("react.memo_cache_sentinel")?(C=(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.ToolsIcon,{})}),R[23]=C):C=R[23],R[24]!==g?(j=(0,l.jsxs)(cA.l.Item,{onSelect:g,children:[C,"Personal instructions"]}),R[24]=g,R[25]=j):j=R[25],R[26]!==q||R[27]!==T?(b="assistive"===T&&(0,l.jsxs)(cA.l.Item,{onSelect:q,children:[(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.HistoryIcon,{})}),"View all conversations"]}),R[26]=q,R[27]=T,R[28]=b):b=R[28],R[29]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{F.current?.openDialog(),(0,ct.BI)("dotcom_chat.activate",{target:"META_CONTEXT_MENU_GIVE_FEEDBACK",mode:"assistive"})},R[29]=y):y=R[29],R[30]===Symbol.for("react.memo_cache_sentinel")?(w=(0,l.jsxs)(cA.l.Item,{onSelect:y,children:[(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.CommentDiscussionIcon,{})}),"Give feedback"]}),R[30]=w):w=R[30],R[31]!==P||R[32]!==$||R[33]!==T?(S="assistive"===T&&!H&&(0,l.jsxs)(cA.l.Item,{onSelect:()=>{$.hideChat(P)},children:[(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.EyeClosedIcon,{})}),"Hide Copilot chat"]}),R[31]=P,R[32]=$,R[33]=T,R[34]=S):S=R[34],R[35]!==c?(N=J&&(0,l.jsxs)(cA.l.Item,{onSelect:()=>c.setShowStaffDialog(cD.hs.Experiments),children:[(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.BeakerIcon,{})}),"Configure experiments",(0,l.jsx)(cA.l.TrailingVisual,{children:(0,l.jsx)(cO.A,{variant:"attention",children:"Staff"})})]}),R[35]=c,R[36]=N):N=R[36],R[37]!==c?(I=J&&W&&(0,l.jsxs)(cA.l.Item,{onSelect:()=>c.setShowStaffDialog(cD.hs.Prompt),children:[(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.BeakerIcon,{})}),"Adjust prompts",(0,l.jsx)(cA.l.TrailingVisual,{children:(0,l.jsx)(cO.A,{variant:"attention",children:"Staff"})})]}),R[37]=c,R[38]=I):I=R[38],R[39]!==M||R[40]!==j||R[41]!==b||R[42]!==S||R[43]!==N||R[44]!==I||R[45]!==h?(O=(0,l.jsx)(cb.UJ,{children:(0,l.jsxs)(cA.l,{children:[h,M,f,j,b,w,S,N,I]})}),R[39]=M,R[40]=j,R[41]=b,R[42]=S,R[43]=N,R[44]=I,R[45]=h,R[46]=O):O=R[46],R[47]!==E||R[48]!==c.anchorRef||R[49]!==O?(k=(0,l.jsxs)(ck.W,{open:E,onOpenChange:z,anchorRef:c.anchorRef,children:[d,O]}),R[47]=E,R[48]=c.anchorRef,R[49]=O,R[50]=k):k=R[50],R[51]===Symbol.for("react.memo_cache_sentinel")?(A=(0,l.jsx)(cE.l,{ref:F,mode:"assistive"}),R[51]=A):A=R[51],R[52]!==k?(D=(0,l.jsxs)(l.Fragment,{children:[k,A]}),R[52]=k,R[53]=D):D=R[53],D};try{c1.displayName||(c1.displayName="Header")}catch{}try{c0.displayName||(c0.displayName="ReturnToCurrentThreadButton")}catch{}try{c2.displayName||(c2.displayName="ThreadOptionButton")}catch{}function c3(c){return!c}var c4=a(79184),c5=a(69726),c6=a(72511),c7=a(10095);let c8={loadingStateContainer:"ThreadListView-module__loadingStateContainer--cQ2Y1",ActionList:"ThreadListView-module__ActionList--vTS9v",emptyStateContainer:"ThreadListView-module__emptyStateContainer--RI0zV",errorStateContainer:"ThreadListView-module__errorStateContainer--xIKxr",deleteAllButton:"ThreadListView-module__deleteAllButton--YxpmP"};function c9(){let c,e,a=(0,n.c)(9),t=(0,i.Pk)(),r=(0,s.b)();a[0]!==r||a[1]!==t.threads?(c=r.sortAndFilterThreads(t.threads,ec),a[0]=r,a[1]=t.threads,a[2]=c):c=a[2];let o=c,[m,z]=(0,_.useState)(!1),d=(0,_.useRef)(null),h=cR.W.deleteAllConversations;if("loading"===t.threadsLoading.state&&o.length<2){let c;return a[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsxs)("div",{className:c8.loadingStateContainer,children:[(0,l.jsx)(c5.A,{}),"Loading threads\u2026"]}),a[3]=c):c=a[3],c}return a[4]!==r||a[5]!==m||a[6]!==t.threadsLoading||a[7]!==o?(e=(0,l.jsx)(l.Fragment,{children:"error"===t.threadsLoading.state?(0,l.jsx)(ee,{threadsLoading:t.threadsLoading}):(0,l.jsxs)(l.Fragment,{children:[o.length>0&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(cA.l,{className:c8.ActionList,children:(0,l.jsxs)(cA.l.Group,{children:[(0,l.jsx)(cA.l.GroupHeading,{as:"h3",children:"All conversations"}),(0,l.jsx)(ea,{threads:o,manager:r}),o.length>1&&h&&(0,l.jsx)(et,{threads:o,manager:r,shouldDeleteAllThreads:m,setShouldDeleteAllThreads:z,returnFocusRef:d})]})})}),0===o.length&&(0,l.jsxs)("div",{className:c8.emptyStateContainer,children:[(0,l.jsx)("p",{className:"mb-3",children:"There are no conversations at the moment."}),(0,l.jsx)(ci.Q,{onClick:()=>r.selectThread(null),block:!0,children:"Start a new conversation"})]})]})}),a[4]=r,a[5]=m,a[6]=t.threadsLoading,a[7]=o,a[8]=e):e=a[8],e}function ec(c){return void 0===c.customCopilotID}let ee=c=>{let e,a,t=(0,n.c)(3),{threadsLoading:r}=c;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(c7.A,{icon:x.AlertIcon}),t[0]=e):e=t[0];let o="error"===r.state?r.error:"Something went wrong. Please try again later.";return t[1]!==o?(a=(0,l.jsx)("div",{className:c8.errorStateContainer,children:(0,l.jsxs)(c6.A,{variant:"warning",children:[e,o]})}),t[1]=o,t[2]=a):a=t[2],a},ea=c=>{let e,a,t=(0,n.c)(7),{threads:r,manager:o}=c;if(t[0]!==o||t[1]!==r){let c;t[3]!==o?(c=c=>(0,l.jsxs)(cA.l.Item,{onSelect:()=>o.selectThread(c),className:"mr-0 pr-2",children:[(0,l.jsx)(cA.l.LeadingVisual,{children:(0,l.jsx)(x.CommentIcon,{})}),(0,m.CB)(c),(0,l.jsx)(cA.l.Description,{variant:"inline",className:"flex-shrink-0",children:(0,l.jsx)(g.A,{date:new Date(Date.parse(c.updatedAt)),format:"relative"})}),(0,l.jsx)(cA.l.TrailingAction,{icon:x.TrashIcon,label:`Delete conversation: "${(0,m.CB)(c)}"`,onClick:async()=>o.deleteThreadKeepSelection(c)})]},c.id),t[3]=o,t[4]=c):c=t[4],e=r.map(c),t[0]=o,t[1]=r,t[2]=e}else e=t[2];return t[5]!==e?(a=(0,l.jsx)(l.Fragment,{children:e}),t[5]=e,t[6]=a):a=t[6],a},et=c=>{let e,a,t,r,o=(0,n.c)(14),{threads:i,manager:s,shouldDeleteAllThreads:m,setShouldDeleteAllThreads:z,returnFocusRef:d}=c;return o[0]!==z?(e=()=>z(!0),o[0]=z,o[1]=e):e=o[1],o[2]!==d||o[3]!==e?(a=(0,l.jsx)(ci.Q,{"data-testid":"delete-all-threads-button",ref:d,onClick:e,className:c8.deleteAllButton,children:"Delete all conversations"}),o[2]=d,o[3]=e,o[4]=a):a=o[4],o[5]!==s||o[6]!==d||o[7]!==z||o[8]!==m||o[9]!==i?(t=!0===m&&(0,l.jsx)("div",{"data-testid":"delete-all-threads-dialog",children:(0,l.jsxs)(cF.l,{title:"Delete all conversations",width:"small",onClose:()=>z(!1),returnFocusRef:d,footerButtons:[{buttonType:"default",content:"Cancel",onClick:()=>z(!1)},{buttonType:"danger",content:"Delete",onClick:async()=>{await s.deleteAllThreadKeepSelection(i),z(!1)},autoFocus:!0}],children:["You are trying to delete ",i.length," conversations. Are you sure? This can\u2019t be undone."]})}),o[5]=s,o[6]=d,o[7]=z,o[8]=m,o[9]=i,o[10]=t):t=o[10],o[11]!==a||o[12]!==t?(r=(0,l.jsxs)(l.Fragment,{children:[a,t]}),o[11]=a,o[12]=t,o[13]=r):r=o[13],r};try{c9.displayName||(c9.displayName="ThreadListView")}catch{}try{ee.displayName||(ee.displayName="ErrorView")}catch{}try{ea.displayName||(ea.displayName="ListView")}catch{}try{et.displayName||(et.displayName="DeleteAll")}catch{}let el={CopilotChatContainer:"CopilotChat-module__CopilotChatContainer--fWXmM",IconButton:"CopilotChat-module__IconButton--jjRoQ",Popover:"CopilotChat-module__Popover--gWIEN",Popover_Content:"CopilotChat-module__Popover_Content--o_2MF",chatContentScrollContainer:"CopilotChat-module__chatContentScrollContainer--eCNUB",chatViewContainer:"CopilotChat-module__chatViewContainer--F1fj4"};var en=a(39619),er=a(46062);let eo=(0,cn.E7)();function ei(c){let e,a=(0,n.c)(2);return a[0]!==c?(e=(0,l.jsx)(cz.RelayEnvironmentProvider,{environment:eo,children:(0,l.jsx)(es,{...c})}),a[0]=c,a[1]=e):e=a[1],e}function es(c){let e,a,t,r,s,m=(0,n.c)(9),z=(0,_.useRef)(null),d=(0,_.useRef)(null),h=cg.Jt.selectedThreadID;m[0]===Symbol.for("react.memo_cache_sentinel")?(e=cg.Jt.getCurrentReferences(h)||[],m[0]=e):e=m[0];let p=e,u=c.renderPopover||!1;return m[1]!==c.reactPartialAnchor||m[2]!==u?(a=(0,l.jsx)(em,{renderPopover:u,ref:z,reactPartialAnchor:c.reactPartialAnchor,inputRef:d}),m[1]=c.reactPartialAnchor,m[2]=u,m[3]=a):a=m[3],m[4]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)(cb.cB,{}),r=(0,l.jsx)(ep,{inputRef:d}),m[4]=t,m[5]=r):(t=m[4],r=m[5]),m[6]!==c||m[7]!==a?(s=(0,l.jsx)(o.LB,{children:(0,l.jsxs)(i.Mj,{topic:c.currentTopic,workerPath:c.findFileWorkerPath,threadId:h,refs:p,mode:"assistive",ssoOrganizations:c.ssoOrganizations,chatIsOpen:!1,chatIsVisible:c.chatIsVisible,chatVisibleSettingPath:c.chatVisibleSettingPath,realIp:c.realIp,copilotChatPayload:c,children:[a,t,r]})}),m[6]=c,m[7]=a,m[8]=s):s=m[8],s}let em=_.forwardRef((c,e)=>{let a,t,r,z,d,h,p,u,M,f,g,C,j,b,y,w,S,N,I=(0,n.c)(62),O=(0,s.b)(),k=(0,i.Pk)();I[0]!==k?(a=(0,cv.W)(k),I[0]=k,I[1]=a):a=I[1];let A=a,{currentTopic:D,currentView:R}=k,{screenSize:E}=(0,o.lm)(),{licenseType:L}=(0,c4.xR)(),P=(0,er.GF)(k.availableModels),T=(0,_.useRef)(!0);I[2]!==D||I[3]!==P||I[4]!==O||I[5]!==A||I[6]!==k.chatIsOpen?(t=()=>(0,en.HS)(c=>void O.handleOpenPanelEvent(A,c,k.chatIsOpen,D,P)),r=[D,A,O,k.chatIsOpen,P],I[2]=D,I[3]=P,I[4]=O,I[5]=A,I[6]=k.chatIsOpen,I[7]=t,I[8]=r):(t=I[7],r=I[8]),(0,_.useEffect)(t,r),I[9]!==O?(z=()=>(0,en.f7)(c=>{O.handleAddReferenceEvent(c)}),I[9]=O,I[10]=z):z=I[10],I[11]!==O||I[12]!==A||I[13]!==k.currentReferences?(d=[A,O,k.currentReferences],I[11]=O,I[12]=A,I[13]=k.currentReferences,I[14]=d):d=I[14],(0,_.useEffect)(z,d),I[15]!==O?(h=()=>(0,en.Tv)(c=>{O.handleSymbolChangedEvent(c)}),I[15]=O,I[16]=h):h=I[16],(0,_.useEffect)(h),I[17]!==P||I[18]!==O?(p=()=>(0,en.fD)(c=>{O.handleSearchCopilotEvent(c,P)}),u=[O,P],I[17]=P,I[18]=O,I[19]=p,I[20]=u):(p=I[19],u=I[20]),(0,_.useEffect)(p,u),I[21]!==R||I[22]!==O||I[23]!==k.chatVisibleSettingPath||I[24]!==k.selectedThreadID||I[25]!==k.threads?(M=()=>{let c=new URL(window.location.href,window.location.origin),e=c.searchParams,a=k.selectedThreadID;if("1"===e.get("copilot")&&a){let e=k.threads.get(a)??null;O.openChat(e,R,"immersive",k.chatVisibleSettingPath),c.searchParams.delete("copilot"),(0,ca.kd)(c.toString())}},f=[O,k.selectedThreadID,k.threads,R,k.chatVisibleSettingPath],I[21]=R,I[22]=O,I[23]=k.chatVisibleSettingPath,I[24]=k.selectedThreadID,I[25]=k.threads,I[26]=M,I[27]=f):(M=I[26],f=I[27]),(0,_.useEffect)(M,f),I[28]!==O||I[29]!==E||I[30]!==A||I[31]!==k.chatIsVisible||I[32]!==k.chatVisibleSettingPath||I[33]!==k.currentView?(g=()=>{T.current&&(T.current=!1,k.chatIsVisible&&!cg.Jt.getCollapsedState()&&E>o.Gy.large&&O.openChat(A,k.currentView,"page load",k.chatVisibleSettingPath))},C=[O,E,A,k.chatIsVisible,k.chatVisibleSettingPath,k.currentView],I[28]=O,I[29]=E,I[30]=A,I[31]=k.chatIsVisible,I[32]=k.chatVisibleSettingPath,I[33]=k.currentView,I[34]=g,I[35]=C):(g=I[34],C=I[35]),(0,_.useEffect)(g,C),I[36]!==D||I[37]!==R||I[38]!==L||I[39]!==O||I[40]!==c.inputRef||I[41]!==A||I[42]!==k.chatIsOpen||I[43]!==k.chatVisibleSettingPath?(j=async()=>{if(k.chatIsOpen)c.inputRef.current&&c.inputRef.current.focus();else{if(L===cD.mF.Unlicensed){if(k.chatVisibleSettingPath){let c=new FormData;c.set("copilot_chat_visible","true"),await (0,cr.DI)(k.chatVisibleSettingPath,{method:"PUT",body:c}),cg.Jt.setCollapsedState(!1)}window.location.replace(`${window.location.origin}/github-copilot/signup?return_to=${window.location.pathname}`);return}O.openChat(A,R,"header",k.chatVisibleSettingPath,(0,m.Z6)(D)?(0,m.qS)(D):void 0)}},I[36]=D,I[37]=R,I[38]=L,I[39]=O,I[40]=c.inputRef,I[41]=A,I[42]=k.chatIsOpen,I[43]=k.chatVisibleSettingPath,I[44]=j):j=I[44];let B=j;if(c.reactPartialAnchor){let e,a,t;return I[45]!==c.reactPartialAnchor?(e=(0,l.jsx)(ez,{reactPartialAnchor:c.reactPartialAnchor}),I[45]=c.reactPartialAnchor,I[46]=e):e=I[46],I[47]!==c.renderPopover?(a=c.renderPopover?(0,l.jsx)(eh,{renderPopover:!0}):(0,l.jsx)(l.Fragment,{}),I[47]=c.renderPopover,I[48]=a):a=I[48],I[49]!==e||I[50]!==a?(t=(0,l.jsxs)("div",{className:el.CopilotChatContainer,children:[e,a]}),I[49]=e,I[50]=a,I[51]=t):t=I[51],t}return I[52]===Symbol.for("react.memo_cache_sentinel")?(b=(0,cm.$)("AppHeader-CopilotChatButton",el.CopilotChatContainer),I[52]=b):b=I[52],I[53]===Symbol.for("react.memo_cache_sentinel")?(y=(0,cm.$)("AppHeader-button",el.IconButton),I[53]=y):y=I[53],I[54]!==B||I[55]!==e?(w=(0,l.jsx)(cs.A,{"aria-label":"Chat with Copilot",direction:"s",children:(0,l.jsx)("div",{children:(0,l.jsx)(v.K,{unsafeDisableTooltip:!0,ref:e,id:cf.fv,icon:x.CopilotIcon,"aria-label":"Chat with Copilot","aria-controls":cf.wJ,onClick:B,className:y,"data-testid":"copilot-chat-button","data-hotkey":"Shift+C","aria-expanded":!1})})}),I[54]=B,I[55]=e,I[56]=w):w=I[56],I[57]!==c.renderPopover?(S=(0,l.jsx)(eh,{renderPopover:c.renderPopover}),I[57]=c.renderPopover,I[58]=S):S=I[58],I[59]!==w||I[60]!==S?(N=(0,l.jsxs)("div",{className:b,children:[w,S]}),I[59]=w,I[60]=S,I[61]=N):N=I[61],N});function ez(c){let e,a=(0,n.c)(1),{reactPartialAnchor:t}=c;return(0,cl.QJ)(t,ed),a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(l.Fragment,{}),a[0]=e):e=a[0],e}function ed(){(0,ct.BI)("dotcom_chat.activate",{target:"GLOBAL_COPILOT_MENU_HEADER_TO_IMMERSIVE",mode:"global_nav"})}function eh(c){let e,a,t,r=(0,n.c)(4),{renderPopover:o}=c,[i,s]=(0,_.useState)(o);r[0]===Symbol.for("react.memo_cache_sentinel")?(e=async()=>{s(!1),await (0,cr.DI)((({notice:c})=>`/settings/dismiss-notice/${c}`)({notice:"copilot_chat_new_user_popover"}),{method:"POST"})},r[0]=e):e=r[0];let m=e;return r[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsxs)(co.A.Content,{"data-testid":"copilot-chat-cta-popover",className:el.Popover_Content,children:[(0,l.jsxs)("p",{children:["You now have access to"," ",(0,l.jsx)("a",{href:"https://docs.github.com/enterprise-cloud@latest/copilot/github-copilot-enterprise/overview/about-github-copilot-enterprise",target:"_blank",rel:"noopener noreferrer",children:"Copilot Enterprise"}),". ","Use the Copilot icon to get started."]}),(0,l.jsx)(ci.Q,{"data-testid":"dismiss-copilot-chat-cta-popover",onClick:m,children:"Got it!"})]}),r[1]=a):a=r[1],r[2]!==i?(t=(0,l.jsx)(co.A,{open:i,caret:"top-right",className:el.Popover,children:a}),r[2]=i,r[3]=t):t=r[3],t}function ep(c){let e,a,t,r,o,m,z,d,h=(0,n.c)(29),{inputRef:p}=c,u=(0,i.Pk)(),M=(0,s.b)(),f=(0,_.useRef)(null),[x,g]=(0,_.useState)(cD.hs.None),[v,C]=(0,_.useState)(!1),j=(0,_.useRef)(u.messages.length),b=(0,_.useRef)(u.messagesLoading.state),{panelWidth:y,panelHeight:w,startResize:S,onResizerKeyDown:N}=(0,cx.Tz)();h[0]!==u.chatIsOpen||h[1]!==u.messages.length||h[2]!==u.messagesLoading.state?(e=()=>{u.messages.length>j.current&&!u.chatIsOpen&&"loaded"===b.current&&C(!0),j.current=u.messages.length,b.current=u.messagesLoading.state},a=[u.chatIsOpen,u.messages.length,u.messagesLoading.state],h[0]=u.chatIsOpen,h[1]=u.messages.length,h[2]=u.messagesLoading.state,h[3]=e,h[4]=a):(e=h[3],a=h[4]),(0,_.useEffect)(e,a),h[5]!==v||h[6]!==u.chatIsOpen?(t=()=>{u.chatIsOpen&&v&&C(!1)},r=[v,u.chatIsOpen],h[5]=v,h[6]=u.chatIsOpen,h[7]=t,h[8]=r):(t=h[7],r=h[8]),(0,_.useEffect)(t,r),h[9]!==M||h[10]!==u.entryPointId?(o=c=>{g(cD.hs.None),M.closeChat();let e=u.entryPointId??cf.fv;if(c&&e){let c=document.getElementById(e),a=window.scrollX,t=window.scrollY;setTimeout(()=>{c?.focus(),window.scrollTo(a,t)},0)}},h[9]=M,h[10]=u.entryPointId,h[11]=o):o=h[11];let I=u.messages.length<=1&&(!!u.streamingMessage||u.isWaitingOnCopilot);return h[12]!==x||h[13]!==I?(m=(0,l.jsx)(c1,{staffDialogRef:f,showStaffDialog:x,setShowStaffDialog:g,isResponding:I}),h[12]=x,h[13]=I,h[14]=m):m=h[14],h[15]!==p||h[16]!==u.chatIsOpen||h[17]!==u.currentView||h[18]!==u.selectedThreadID?(z=u.chatIsOpen&&(0,l.jsx)("div",{className:el.chatContentScrollContainer,children:(0,l.jsx)("div",{className:el.chatViewContainer,children:"thread"===u.currentView?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(cd.r,{inputRef:p},u.selectedThreadID),(0,l.jsx)(ce,{})]}):(0,l.jsx)(c9,{})})}),h[15]=p,h[16]=u.chatIsOpen,h[17]=u.currentView,h[18]=u.selectedThreadID,h[19]=z):z=h[19],h[20]!==p||h[21]!==N||h[22]!==w||h[23]!==y||h[24]!==S||h[25]!==o||h[26]!==m||h[27]!==z?(d=(0,l.jsxs)(cy,{staffDialogRef:f,handleClose:o,panelWidth:y,panelHeight:w,startResize:S,onResizerKeyDown:N,initialFocusRef:p,children:[m,z]}),h[20]=p,h[21]=N,h[22]=w,h[23]=y,h[24]=S,h[25]=o,h[26]=m,h[27]=z,h[28]=d):d=h[28],d}em.displayName="CopilotHeaderButton",ep.displayName="ChatPanelWithHeader";try{ei.displayName||(ei.displayName="CopilotChat")}catch{}try{es.displayName||(es.displayName="CopilotChatNoRelay")}catch{}try{ez.displayName||(ez.displayName="ExternalAnchorListener")}catch{}try{eh.displayName||(eh.displayName="WelcomePopover")}catch{}(0,t.k)("copilot-chat",{Component:ei})},29731:(c,e,a)=>{a.d(e,{G:()=>t});let t=c=>({})},39595:(c,e,a)=>{let t;a.d(e,{CF:()=>u,p_:()=>O,FB:()=>z,Se:()=>b,aC:()=>N,zV:()=>I});let l=new WeakSet,n=new WeakMap;function r(c=document){if(n.has(c))return n.get(c);let e=!1,a=new MutationObserver(c=>{for(let e of c)if("attributes"===e.type&&e.target instanceof Element)m(e.target);else if("childList"===e.type&&e.addedNodes.length)for(let c of e.addedNodes)c instanceof Element&&o(c)});a.observe(c,{childList:!0,subtree:!0,attributeFilter:["data-action"]});let t={get closed(){return e},unsubscribe(){e=!0,n.delete(c),a.disconnect()}};return n.set(c,t),t}function o(c){for(let e of c.querySelectorAll("[data-action]"))m(e);c instanceof Element&&c.hasAttribute("data-action")&&m(c)}function i(c){let e=c.currentTarget;for(let a of s(e))if(c.type===a.type){let t=e.closest(a.tag);l.has(t)&&"function"==typeof t[a.method]&&t[a.method](c);let n=e.getRootNode();if(n instanceof ShadowRoot&&l.has(n.host)&&n.host.matches(a.tag)){let e=n.host;"function"==typeof e[a.method]&&e[a.method](c)}}}function*s(c){for(let e of(c.getAttribute("data-action")||"").trim().split(/\s+/)){let c=e.lastIndexOf(":"),a=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,c),tag:e.slice(c+1,a),method:e.slice(a+1)||"handleEvent"}}}function m(c){for(let e of s(c))c.addEventListener(e.type,i)}function z(c,e){let a=c.tagName.toLowerCase();if(c.shadowRoot){for(let t of c.shadowRoot.querySelectorAll(`[data-target~="${a}.${e}"]`))if(!t.closest(a))return t}for(let t of c.querySelectorAll(`[data-target~="${a}.${e}"]`))if(t.closest(a)===c)return t}let d=c=>String("symbol"==typeof c?c.description:c).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),h=(c,e="property")=>{let a=d(c);if(!a.includes("-"))throw new DOMException(`${e}: ${String(c)} is not a valid ${e} name`,"SyntaxError");return a},p="attr";function u(c,e){S(c,p).add(e)}let M=new WeakSet;function f(c,e){if(M.has(c))return;M.add(c);let a=Object.getPrototypeOf(c),t=a?.constructor?.attrPrefix??"data-";for(let l of(e||(e=S(a,p)),e)){let e=c[l],a=h(`${t}${l}`),n={configurable:!0,get(){return this.getAttribute(a)||""},set(c){this.setAttribute(a,c||"")}};"number"==typeof e?n={configurable:!0,get(){return Number(this.getAttribute(a)||0)},set(c){this.setAttribute(a,c)}}:"boolean"==typeof e&&(n={configurable:!0,get(){return this.hasAttribute(a)},set(c){this.toggleAttribute(a,c)}}),Object.defineProperty(c,l,n),l in c&&!c.hasAttribute(a)&&n.set.call(c,e)}}let x=new Map,g=new Promise(c=>{"loading"!==document.readyState?c():document.addEventListener("readystatechange",()=>c(),{once:!0})}),v=new Promise(c=>{let e=new AbortController;e.signal.addEventListener("abort",()=>c());let a={once:!0,passive:!0,signal:e.signal},t=()=>e.abort();document.addEventListener("mousedown",t,a),document.addEventListener("touchstart",t,a),document.addEventListener("keydown",t,a),document.addEventListener("pointerdown",t,a)}),C={ready:()=>g,firstInteraction:()=>v,visible:c=>new Promise(e=>{let a=new IntersectionObserver(c=>{for(let t of c)if(t.isIntersecting){e(),a.disconnect();return}},{rootMargin:"0px 0px 256px 0px",threshold:.01});for(let e of document.querySelectorAll(c))a.observe(e)})},_=new WeakMap;function j(c){cancelAnimationFrame(_.get(c)||0),_.set(c,requestAnimationFrame(()=>{for(let e of x.keys()){let a=c instanceof Element&&c.matches(e)?c:c.querySelector(e);if(customElements.get(e)||a){let t=a?.getAttribute("data-load-on")||"ready",l=t in C?C[t]:C.ready;for(let c of x.get(e)||[])l(e).then(c);x.delete(e),_.delete(c)}}}))}function b(c,e){for(let[a,t]of("string"==typeof c&&e&&(c={[c]:e}),Object.entries(c)))x.has(a)||x.set(a,new Set),x.get(a).add(t);y(document)}function y(c){t||(t=new MutationObserver(c=>{if(x.size)for(let e of c)for(let c of e.addedNodes)c instanceof Element&&j(c)})),j(c),t.observe(c,{subtree:!0,childList:!0})}let w=Symbol.for("catalyst");let CatalystDelegate=class CatalystDelegate{constructor(c){let e=this,a=c.prototype.connectedCallback;c.prototype.connectedCallback=function(){e.connectedCallback(this,a)};let t=c.prototype.disconnectedCallback;c.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,t)};let l=c.prototype.attributeChangedCallback;c.prototype.attributeChangedCallback=function(c,a,t){e.attributeChangedCallback(this,c,a,t,l)};let n=c.observedAttributes||[];Object.defineProperty(c,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,n)},set(c){n=c}}),function(c){let e=c.observedAttributes||[],a=c.attrPrefix??"data-",t=c=>h(`${a}${c}`);Object.defineProperty(c,"observedAttributes",{configurable:!0,get:()=>[...S(c.prototype,p)].map(t).concat(e),set(c){e=c}})}(c),function(c){let e=d(c.name).replace(/-element$/,"");try{window.customElements.define(e,c),window[c.name]=customElements.get(e)}catch(c){if(!(c instanceof DOMException&&"NotSupportedError"===c.name))throw c}}(c)}observedAttributes(c,e){return e}connectedCallback(c,e){var a,t;for(let e of(c.toggleAttribute("data-catalyst",!0),customElements.upgrade(c),c.querySelectorAll("template[data-shadowroot]")))e.parentElement===c&&c.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0));(f(c),l.add(c),c.shadowRoot&&(o(t=c.shadowRoot),r(t)),o(c),r(c.ownerDocument),e?.call(c),c.shadowRoot)&&(o(a=c.shadowRoot),r(a),y(c.shadowRoot))}disconnectedCallback(c,e){e?.call(c)}attributeChangedCallback(c,e,a,t,l){f(c),"data-catalyst"!==e&&l&&l.call(c,e,a,t)}};function S(c,e){if(!Object.prototype.hasOwnProperty.call(c,w)){let e=c[w],a=c[w]=new Map;if(e)for(let[c,t]of e)a.set(c,new Set(t))}let a=c[w];return a.has(e)||a.set(e,new Set),a.get(e)}function N(c,e){S(c,"target").add(e),Object.defineProperty(c,e,{configurable:!0,get(){return z(this,e)}})}function I(c,e){S(c,"targets").add(e),Object.defineProperty(c,e,{configurable:!0,get(){let c=this.tagName.toLowerCase(),a=[];if(this.shadowRoot)for(let t of this.shadowRoot.querySelectorAll(`[data-targets~="${c}.${e}"]`))t.closest(c)||a.push(t);for(let t of this.querySelectorAll(`[data-targets~="${c}.${e}"]`))t.closest(c)===this&&a.push(t);return a}})}function O(c){new CatalystDelegate(c)}},39619:(c,e,a)=>{a.d(e,{HS:()=>r,Oc:()=>n,Tv:()=>s,Xr:()=>SymbolChangedEvent,f7:()=>o,fD:()=>i,qR:()=>l});var t=a(50467);let OpenCopilotChatEvent=class OpenCopilotChatEvent extends Event{constructor(c){super("open-copilot-chat",{bubbles:!1,cancelable:!0}),(0,t._)(this,"payload",void 0),this.payload=c}};Event;let AddCopilotChatReferenceEvent=class AddCopilotChatReferenceEvent extends Event{constructor(c,e=!1,a){super("add-copilot-chat-reference",{bubbles:!1,cancelable:!0}),(0,t._)(this,"reference",void 0),(0,t._)(this,"openPanel",void 0),(0,t._)(this,"id",void 0),this.reference=c,this.openPanel=e,this.id=a}};let SymbolChangedEvent=class SymbolChangedEvent extends Event{constructor(c){super("symbol-changed",{bubbles:!1,cancelable:!0}),(0,t._)(this,"context",void 0),this.context=c}};function l(c){window.dispatchEvent(new OpenCopilotChatEvent(c))}function n(c,e=!1,a){window.dispatchEvent(new AddCopilotChatReferenceEvent(c,e,a))}function r(c){return window.addEventListener("open-copilot-chat",c),()=>{window.removeEventListener("open-copilot-chat",c)}}function o(c){return window.addEventListener("add-copilot-chat-reference",c),()=>{window.removeEventListener("add-copilot-chat-reference",c)}}function i(c){return window.addEventListener("search-copilot-chat",c),()=>{window.removeEventListener("search-copilot-chat",c)}}function s(c){return window.addEventListener("symbol-changed",c),()=>{window.removeEventListener("symbol-changed",c)}}},45244:(c,e,a)=>{a.d(e,{b:()=>o});var t=a(74848),l=a(21728),n=a(34164);let r={shimmerText:"WithShimmerEffect-module__shimmerText--Rzh6H",fadeIn:"WithShimmerEffect-module__fadeIn--UnU0Y"},o=c=>{let e,a,o,i,s=(0,l.c)(8),{children:m,className:z}=c;return s[0]!==z?(e=(0,n.$)(r.fadeIn,z),s[0]=z,s[1]=e):e=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.$)(r.shimmerText),s[2]=a):a=s[2],s[3]!==m?(o=(0,t.jsx)("div",{className:a,children:m}),s[3]=m,s[4]=o):o=s[4],s[5]!==e||s[6]!==o?(i=(0,t.jsx)("div",{className:e,children:o}),s[5]=e,s[6]=o,s[7]=i):i=s[7],i};try{o.displayName||(o.displayName="WithShimmerEffect")}catch{}},45385:(c,e,a)=>{a.d(e,{u:()=>r});var t=a(25407),l=a(96379),n=a(96540);function r(c,e,a,r){let[o,i]=(0,n.useState)({loading:!0}),s=e&&c&&a&&r?(0,t.IO9)({repo:{name:e,ownerLogin:c},commitish:a,action:"file-contributors",path:r}):null;return(0,n.useEffect)(()=>{if(!s)return;let c=!1;return(async()=>{i({loading:!0});let e=await (0,l.lS)(s);if(!c)try{e.ok?i({contributors:await e.json()}):i({error:!0})}catch{i({error:!0})}})(),function(){c=!0}},[s]),o}},46747:(c,e,a)=>{a.d(e,{d:()=>r});var t=a(31223),l=a(23125),n=a(96540);let r=(c,e,{leading:a=!1,maxWait:r,trailing:o=!0,onChangeBehavior:i="flush"}={})=>{let s=(0,t.M)(c),m=(0,n.useMemo)(()=>{let c=void 0===r?{leading:a,trailing:o}:{leading:a,trailing:o,maxWait:r};return(0,l.A)((...c)=>s.current(...c),e,c)},[s,e,a,r,o]);return(0,n.useEffect)(()=>()=>{m?.[i]()},[m,i]),m}},53419:(c,e,a)=>{let t;a.d(e,{BI:()=>p,Ti:()=>u,lA:()=>d,sX:()=>h});var l=a(70837),n=a(18679),r=a(82075),o=a(11083);let{getItem:i}=(0,r.A)("localStorage"),s="dimension_",m=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","scid"];try{let c=(0,l.O)("octolytics");delete c.baseContext,t=new n.s(c)}catch{}function z(c){let e=(0,l.O)("octolytics").baseContext||{};if(e)for(let[c,a]of(delete e.app_id,delete e.event_url,delete e.host,Object.entries(e)))c.startsWith(s)&&(e[c.replace(s,"")]=a,delete e[c]);let a=document.querySelector("meta[name=visitor-payload]");for(let[c,t]of(a&&Object.assign(e,JSON.parse(atob(a.content))),new URLSearchParams(window.location.search)))m.includes(c.toLowerCase())&&(e[c]=t);return e.staff=(0,o.X)().toString(),Object.assign(e,c)}function d(c){t?.sendPageView(z(c))}function h(){return document.head?.querySelector('meta[name="current-catalog-service"]')?.content}function p(c,e={}){let a=h(),l=a?{service:a}:{};for(let[c,a]of Object.entries(e))null!=a&&(l[c]=`${a}`);t&&(z(l),t.sendEvent(c||"unknown",z(l)))}function u(c){return Object.fromEntries(Object.entries(c).map(([c,e])=>[c,JSON.stringify(e)]))}},54571:(c,e,a)=>{a.d(e,{I:()=>r});var t=a(96540),l=a(88431),n=a(76629);function r(c,e,a=[]){let o=(0,t.useCallback)(c,a),i=(0,n.BP)(),s=(0,t.useRef)(i===n.O8.ClientRender),[m,z]=(0,t.useState)(()=>i===n.O8.ClientRender?o():e),d=(0,t.useCallback)(()=>{z(o)},[o]);return(0,l.N)(()=>{s.current||z(o),s.current=!1},[o,...a]),[m,d]}},54589:(c,e,a)=>{a.d(e,{X:()=>o});var t=a(74848),l=a(26607),n=a(10242),r=a(84174);let o=({children:c="Preview",feedbackUrl:e,className:a})=>(0,t.jsx)(r.V,{className:a,label:(0,t.jsx)(l.A,{variant:"success",children:c}),link:e?(0,t.jsx)(n.A,{feedbackUrl:e}):void 0});try{o.displayName||(o.displayName="BetaLabel")}catch{}},68911:(c,e,a)=>{a.d(e,{D7:()=>l,MQ:()=>t,gE:()=>n});let t=c=>{if(c){if(c.startsWith("refs/tags/"))return"tag";if(c.startsWith("refs/heads/"))return"branch"}},l=(c,e)=>"branch"===e?`refs/heads/${c}`:"tag"===e?`refs/tags/${c}`:c,n=c=>{if(!c)return;if(!t(c))return c;let[,,...e]=c.split("/");return e.join("/")}},71555:(c,e,a)=>{a.d(e,{a:()=>O});var t=a(74848),l=a(70170),n=a(71315),r=a(83494),o=a(8625),i=a(50691),s=a(21513),m=a(56149),z=a(34164),d=a(24249),h=a(96540),p=a(5524),u=a(50463),M=a(63307),f=a(40090);let x={Overlay_0:"AutocompleteSuggestions-module__Overlay_0--LMGK_",suggestion:"AutocompleteSuggestions-module__suggestion--ted1j",ActionList_0:"AutocompleteSuggestions-module__ActionList_0--iXEKc"},g=new Set([" ",` `]),v=new Set([".",` `]),C=c=>"string"==typeof c?c:c.value,_=c=>"string"==typeof c?c:null===c.value?c.key:c.key??c.value,j=(...c)=>e=>{for(let a of[...c].reverse())e.isDefaultPrevented()||a?.(e)},b=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.l.Item,{disabled:!0,children:(0,t.jsx)(f.r,{})}),(0,t.jsx)(p.l.Item,{disabled:!0,children:(0,t.jsx)(f.r,{})}),(0,t.jsx)(p.l.Item,{disabled:!0,children:(0,t.jsx)(f.r,{})})]}),y=({suggestion:c,onSelect:e,isActive:a,id:l,parentRole:n})=>{let r={id:l,children:C(c),role:"menu"===n?"menuitem":"option",active:a,className:x.suggestion,"aria-selected":"listbox"===n&&!!a||void 0,onMouseDown:c=>{c.preventDefault(),e()}};return"string"==typeof c?(0,t.jsx)(p.l.Item,{...r}):c.render(r)},w=({suggestions:c,portalName:e,triggerCharCoords:a,onClose:l,onCommit:n,inputRef:r,visible:o,defaultPlacement:i,activeSuggestion:s,getSuggestionId:m,id:z,menuTitle:d,role:f})=>{let g=(0,h.useRef)(null),[v,C]=(0,h.useState)(0),[j,w]=(0,h.useState)("auto");(0,u.A)(function(){w("auto");let c=g.current?.offsetHeight??0,e=a.top+a.height,t=e+c>window.innerHeight,l=a.top-c,n=l<0,r={below:t&&!n?l:e,above:n&&!t?e:l}[i];if(Number.isNaN(r)&&(r=0),C(Math.max(0,r)),t&&n){let c="above"===i?window.innerHeight+r:window.innerHeight-r;w(`${c}px`)}},[a.top,a.height,c,o,i]);let S=(0,t.jsx)(t.Fragment,{children:"loading"===c?(0,t.jsx)(b,{}):c?.map(c=>(0,t.jsx)(y,{suggestion:c,id:m(c),onSelect:()=>n(c),isActive:s===c,parentRole:f},_(c)))}),N=(0,h.useId)();return o?(0,t.jsx)(M.Ay,{onEscape:l,onClickOutside:l,returnFocusRef:r,preventFocusOnOpen:!0,portalContainerName:e,top:v,left:a.left,ref:g,className:x.Overlay_0,children:(0,t.jsx)(p.l,{role:f,id:z,"aria-label":d?void 0:"Autocomplete suggestions","aria-labelledby":d?N:void 0,className:x.ActionList_0,style:{height:j},children:d?(0,t.jsxs)(p.l.Group,{children:[(0,t.jsx)(p.l.GroupHeading,{id:N,children:d}),S]}):S})}):(0,t.jsx)(t.Fragment,{})};try{b.displayName||(b.displayName="LoadingIndicator")}catch{}try{y.displayName||(y.displayName="SuggestionListItem")}catch{}try{w.displayName||(w.displayName="AutocompleteSuggestions")}catch{}let S={container:"InlineAutocomplete-module__container--lzMAk",fullWidth:"InlineAutocomplete-module__fullWidth--xhTmc"},N=c=>{try{return c.selectionStart}catch(c){if(c instanceof TypeError)return null;throw c}},I=()=>{},O=({triggers:c,suggestions:e,onShowSuggestions:a,onHideSuggestions:p,onSelectSuggestion:u,style:M,children:f,tabInsertsSuggestions:x=!1,suggestionsPlacement:b="below",portalName:y,fullWidth:O=!1,title:k,asMenu:A,...D})=>{let[,R]=(0,h.useState)(0),E=(0,i.Lf)(D),L=(0,h.useRef)(null);(0,s.T)(f.ref??I,L);let P=function(c,e){if(h.Children.only(c),e.current&&!(e.current instanceof HTMLInputElement)&&!(e.current instanceof HTMLTextAreaElement))throw TypeError("AutocompleteTextarea child must be a component that forwards a ref and props to an or